Commit graph

147 commits

Author SHA1 Message Date
Linus Heckemann c0f963a338 boot.initrd.services.swraid -> boot.swraid
Since the option affects both stage-1 and stage-2, it does not make
sense to keep it within the boot.initrd namespace.
2023-07-10 20:20:08 +02:00
Linus Heckemann 0b277bcc2b nixos/swraid: make entire module optional
swraid support will now only be enabled by default if stateVersion is
older than 23.11. nixos-generate-config will now generate explicit
config for enabling support if needed.
2023-07-10 16:39:35 +02:00
Robert Hensing 1350e522fa nixos-generate-config: Fix generated hostPlatform.system
While the intent of the code was correct, the system string can not be used
in the substituteAll function.

See https://github.com/NixOS/nixpkgs/issues/237216
2023-06-11 19:28:51 +02:00
Matthias Berndt cb410a8c59 Merge remote-tracking branch 'upstream/master' into mberndt123/stratis-rootfs 2023-05-17 21:47:19 -04:00
Matthias Berndt 3aa262b644 make nixos-generate-config generate stratis pool UUIDs 2023-05-15 20:48:10 -04:00
ajs124 30bea8d82d nixos/*: remove boot.grub.version 2023-05-10 21:51:26 +02:00
name_snrl 1aa8534f3e nixos/nixos-generate-config: use hostPlatform.system instead of calling nix 2023-04-26 23:51:48 +05:00
R-VdP 3078cdb780 nixos/nixos-generate-config: include new device ID for virtio_scsi
Device IDs found here:
https://devicehunt.com/view/type/pci/vendor/1AF4/device/1048
2023-04-18 18:05:53 +00:00
Sandro 603320b64f
Merge pull request #204534 from SuperSandro2000/boot-tmp 2023-04-12 21:37:47 +02:00
K900 4787ebf7ae nixos/hidpi: remove
The single option tries to do too much work, which just ends up confusing people.

So:
- don't force the console font, the kernel can figure this out as of #210205
- don't force the systemd-boot mode, it's an awkward mode that's not supported
  on most things and will break flicker-free boot
- add a separate option for the xorg cursor scaling trick and move it under the xorg namespace
- add a general `fonts.optimizeForVeryHighDPI` option that explicitly says what it does
- alias the old option to that
- don't set any of those automatically in nixos-generate-config
2023-03-21 13:29:57 +01:00
Sandro Jäckel a5d95ac5fc
nixos/tmp: move /tmp options under boot.tmp 2023-03-19 18:49:37 +01:00
Luflosi 1d65c7279c
nixos-generate-config: update microcode only on bare metal
Guest operating systems inside VMs or containers can't update the host CPU's microcode for obvious security reasons, so setting the `hardware.cpu.*.updateMicrocode` options is pointless.
2023-03-13 20:15:13 +01:00
Maëlys Bras de fer b2224764ee
nixos-generate-config: substitute nix-instantiate 2022-07-07 18:42:44 +02:00
Kirill A. Korinsky 08ddd8a5fc
nixos-generate-config: detect parallels virtualization 2022-06-29 16:01:08 +02:00
Robert Hensing 82da0794c2 nixos-generate-config: Make robust against missing newline
The substr solution assumed a newline to be present.
The new solution will not remove the newline if it goes missing in the future.

Apparently this is idiomatic perl.

Thanks pennae for the suggestion!
2022-06-21 14:37:16 +02:00
Robert Hensing fc0971f436 nixos-generate-config: nixpkgs.system -> nixpkgs.hostPlatform 2022-06-21 14:22:36 +02:00
Robert Hensing a234fb2a5b nixos-generate-config: Add nixpkgs.system to hardware-config.nix 2022-06-21 14:21:17 +02:00
Maximilian Bosch f4e5bd8064
nixos/nixos-generate-config: update comment for useDHCP 2022-05-06 16:56:47 +02:00
Maximilian Bosch 8e42949a24
nixos/nixos-generate-config: use networking.useDHCP by default
Currently we're still using scripted networking by default. A problem
with scripted networking is that having `useDHCP` on potentially
non-existing interfaces (e.g. an ethernet interface for USB tethering)
can cause the boot to hang.

Closes #107908
2022-04-30 00:30:47 +02:00
Artturin 611b8c4472 nixos/nixos-generate-config: fix specifying --root /mnt --dir adir
it should save to `$PWD/adir` instead of `/mnt/adir`
and --dir adir should save to `$PWD/adir` instead of `/adir`
2022-03-18 23:16:19 +02:00
andr1an 00487b5a87 nixos/nixos-generate-config: resolve abspath to root 2022-03-18 23:16:06 +02:00
Artturin b4adac9ba9 nixos/nixos-generate-config: move dhcpConfig from configuration.nix to hardware-configuration.nix 2022-02-09 19:35:19 +02:00
Artturin aaf13bb3bd nixos/nixos-generate-config: fix proram path replacements
btrfs-progs was made optional in 2019 c01ea27ce3
because it didn't cross-compile. it now does
2022-02-09 18:38:17 +02:00
Artturin f93a7f8b56 nixos-generate-config: automatically enable microcode updates 2021-11-15 22:28:41 +02:00
WORLDofPEACE 452f7e14d4 nixos/tools: generate an xserver config
The desktop configuration won't enable xserver.
If there's multiple desktops enabled they will now evaluate properly.
2021-02-13 18:46:01 -05:00
Victor Nawothnig 27e9328895 Support virtio_scsi devices on nixos-generate-config 2020-11-04 10:00:28 +01:00
WORLDofPEACE 99d5111246 nixos/tools: add desktopConfiguration option
We now have a GNOME ISO so it would be nice to seed that one
with configuration on how to enable it.
2020-10-12 22:03:16 -04:00
Eelco Dolstra b551f06097 nixos-generate-config: Add missing newline 2020-10-03 10:48:39 +02:00
Linus Heckemann a5d20d25eb
Merge pull request #88669 from Mic92/hidpi
nixos/hidpi: Reasonable defaults for high-density displays
2020-07-22 17:43:03 +02:00
Jörg Thalheim e943489f24
nixos-generate-config: refer to nixos-hardware 2020-06-22 23:51:08 +01:00
Jörg Thalheim 435340ed58
nixos-generate-config: enable hidpi module for displays 2020-05-24 16:32:03 +01:00
Matthew Bauer c45295d47e nixos/nixos-generate-config.pl: use modulesPath instead of <nixpkgs>
For imports, it is better to use ‘modulesPath’ than rely on <nixpkgs>
being correctly set. Some users may not have <nixpkgs> set correctly.
In addition, when ‘pure-eval=true’, <nixpkgs> is unset.
2020-04-20 09:57:17 -05:00
Jörg Thalheim e6a15db534
nixos: default nix.maxJobs to auto
Instead of making the configuration less portable by hard coding the number of
jobs equal to the cores we can also let nix set the same number at runtime.
2020-04-07 08:45:56 +01:00
Pavol Rusnak 4899c6992c
nixos-generate-config: i18n.consoleFont has been renamed to console.font
fixes #76391
2019-12-25 15:02:58 +01:00
buckley310 ebbb7165c5 nixos-generate-config: don't generate swapDevices for zram devices (#75921) 2019-12-19 22:03:21 +02:00
Robin Gloster 5ee383ea8c
nixos-generate-config: add useDHCP per interface
This sets networking.useDHCP to false and for all interfaces found the
per-interface useDHCP to true. This replicates the current default
behaviour and prepares for the switch to networkd.
2019-09-24 11:44:01 +02:00
Bas van Dijk 810388afd2 nixos-generate-config: enable overriding configuration.nix 2019-08-08 17:00:10 +02:00
Bjørn Forsman 8f551be935 nixos-generate-config: don't emit tmpfs entry for /tmp
Because it most likely comes from the boot.tmpOnTmpfs option in
configuration.nix (managed declaratively).
2019-06-16 16:21:54 +02:00
Bjørn Forsman 4213e48dd9 nixos-generate-config: add dm-snapshot module if LVM is detected
Without this, the system becomes unbootable if the user creates a LVM
snapshot and reboots.

Fixes https://github.com/NixOS/nixpkgs/issues/33646

(The same kind of problem was fixed in RHEL a few years back:
https://bugzilla.redhat.com/show_bug.cgi?id=1287940)
2019-06-16 15:30:54 +02:00
Bjørn Forsman 9e45f6feac nixos-generate-config: don't generate swapDevices for *files*
Up until now, the output has been the same for swap devices and swap
files:

  { device = "/var/swapfile"; }

Whereas for swap *files* it's easier to manage them declaratively in
configuration.nix:

  { device = "/var/swapfile"; size = 8192; }

(NixOS will create the swapfile, and later resize it, if the size
attribute is changed.)

With the assumption that swap files are specified in configuration.nix,
it's silly to output them to hardware-configuration.nix.
2019-06-16 15:26:33 +02:00
Bjørn Forsman 4755811a12 nixos-generate-config: add support for bcache
Add "bcache" to boot.initrd.availableKernelModules if a bcache device is
detected.

This fixes a problem I've had one too many times: I install NixOS and
forget to add "bcache", resulting in an unbootable machine (until fixed
with Live CD). Now NixOS will do it for me.
2019-06-10 21:22:07 +02:00
Linus Heckemann 89b64ab5e1 nixos-generate-config: add rudimentary high-DPI detection
Fixes the main remaining part of #12345
2019-05-15 06:34:40 +02:00
Eelco Dolstra 07208e7a0b
nixos-generate-config: Don't suggest setting a uid
This hasn't been needed for a long time, even when `mutableUsers =
false`. Setting a uid manually is potentially risky since it could
collide with non-declarative user accounts. (We do check for
collisions between declarative accounts.)
2019-02-11 10:49:25 +01:00
aanderse c01eeda8e9 nixos-generate-config: account for mount points & devices with spaces & tabs in the name (#50234) 2019-02-03 14:33:31 +01:00
devhell c3d22fdca1 nixos-generate-config: Include extraGroups "wheel"
I've been asked, on numerous occasions, by my students and others, how
to 'sudo' on NixOS.

Of course new users could read up in the manual on how to do that, or we
could make it more accessible for them by simply making it visible in
the default `configuration.nix` file.

Additionally, as raised in [1], replacing `guest` with something more
recognizable could be potentially beneficial to new users. I've
opted for `jane` for now.

[1]: https://github.com/NixOS/nixpkgs/pull/54519#issuecomment-457012223
2019-01-27 20:33:36 +00:00
Claudio Bley 352e06d3da installer/tools: Avoid duplicate LUKS device entries in hw config
There are situations where several filesystems reside on a single encrypted LUKS
device (e.g. when using BTRFS subvolumes).

Simply generating a `boot.init.luks.devices.NAME.device` entry for each mounted
filesystem will result in an error later when evaluating the nix expression in
`hardware-configuration.nix`.
2019-01-19 22:02:49 +01:00
(cdep)illabout 46ecec8239
nixos/cpufreq: Remove the alias to set the cpu frequency governor
This PR temporarily fixes the issue with PR 53041 as explained
here:

https://github.com/NixOS/nixpkgs/pull/53041#commitcomment-31825338

The alias `powerManagement.cpufreq.governor` to
`powerManagement.cpuFreqGovernor` has been removed.
2019-01-03 20:57:49 +09:00
(cdep)illabout b0f10d2d53
cpufreq: add option for setting the cpu max and min frequencies
This adds a NixOS option for setting the CPU max and min frequencies
with `cpufreq`.  The two options that have been added are:

- `powerManagement.cpufreq.max`
- `powerManagement.cpufreq.min`

It also adds an alias to the `powerManagement.cpuFreqGovernor` option as
`powerManagement.cpufreq.governor`.  This updates the installer to use
the new option name.  It also updates the manual with a note about
the new name.
2019-01-01 19:18:12 +09:00
Patrick Hilhorst ce65df3a36
nixos-generate-config: fix for swapless kernels
Fixes #49826
2018-11-06 17:32:54 +01:00
Eelco Dolstra b6bac6c144
Revert "Merge pull request #48122 from zimbatm/pkg-nixos-rebuild"
This reverts commit 10addad603, reversing
changes made to 7786575c6c.

NixOS scripts should be kept in the NixOS source tree, not in
pkgs. Moving them around is just confusing and creates unnecessary
code/history churn.
2018-10-16 20:25:44 +02:00
Renamed from pkgs/tools/nixos/nixos-generate-config/nixos-generate-config.pl (Browse further)