diff --git a/Makefile b/Makefile index 4301538..0a6d026 100644 --- a/Makefile +++ b/Makefile @@ -52,9 +52,17 @@ install-hm: nix-channel --update nix-shell '' -A install +.PHONY: installer +installer: + nix build -o installer $(options) $(flake)#nixosConfigurations.installer.config.system.build.isoImage + .PHONY: live live: - nix build -o live $(options) $(flake)#nixosConfigurations.live.config.system.build.isoImage + nix build -o installer $(options) $(flake)#nixosConfigurations.live.config.system.build.isoImage + +.PHONY: recovery +recovery: + nix build -o installer $(options) $(flake)#nixosConfigurations.recovery.config.system.build.isoImage no-nixconf: mv /etc/nix/nix.conf /etc/nix/nix.conf_ || true diff --git a/config/Live.nix b/config/Live.nix new file mode 100644 index 0000000..187ecbc --- /dev/null +++ b/config/Live.nix @@ -0,0 +1,21 @@ +{ lib, config, inputs, ... }: +let + cfg = config.module.live; +in +{ + config = lib.mkIf cfg.enable { + imports = [ + "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" + "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" + ]; + + networking.wireless.enable = lib.mkForce false; + + # Override my settings to allow SSH logins using root password. + services.openssh.settings = { + PasswordAuthentication = lib.mkForce true; + PermitRootLogin = lib.mkForce "yes"; + }; + }; +} + diff --git a/host/x86_64-linux/installer/default.nix b/host/x86_64-linux/installer/default.nix new file mode 100644 index 0000000..3ea7774 --- /dev/null +++ b/host/x86_64-linux/installer/default.nix @@ -0,0 +1,22 @@ +{ ... }: +{ + # Root user setup. + home.nixos.enable = true; + user.root = true; + + module = { + keyd.enable = true; + purpose = { + live = true; + }; + package = { + common = true; + core = true; + creative = true; + desktop = true; + dev = true; + extra = true; + gaming = true; + }; + }; +} diff --git a/host/x86_64-linux/live/default.nix b/host/x86_64-linux/live/default.nix deleted file mode 100644 index 742f286..0000000 --- a/host/x86_64-linux/live/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ inputs, lib, ... }: -{ - imports = [ - "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" - "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" - ]; - - networking.wireless.enable = lib.mkForce false; - - # Override my settings to allow SSH logins using root password. - services.openssh.settings = { - PasswordAuthentication = lib.mkForce true; - PermitRootLogin = lib.mkForce "yes"; - }; - - # Root user setup. - home.nixos.enable = true; - user = { - root = true; - voronind = true; - }; - - module = { - keyd.enable = true; - sway.enable = true; - kernel.enable = true; - wallpaper.video = false; - package = { - common = true; - core = true; - creative = true; - desktop = true; - dev = true; - extra = true; - gaming = true; - }; - }; -} diff --git a/option/Live.nix b/option/Live.nix new file mode 100644 index 0000000..9196358 --- /dev/null +++ b/option/Live.nix @@ -0,0 +1,9 @@ +{ lib, config, ... }: +let + purpose = config.module.purpose; +in +{ + options.module.live.enable = lib.mkEnableOption "the live modules." // { + default = purpose.live; + }; +} diff --git a/option/Purpose.nix b/option/Purpose.nix index c205900..2b49517 100644 --- a/option/Purpose.nix +++ b/option/Purpose.nix @@ -6,6 +6,7 @@ disown = lib.mkEnableOption "modules for machines not used by me."; gaming = lib.mkEnableOption "gaming modules."; laptop = lib.mkEnableOption "laptop modules."; + live = lib.mkEnableOption "live modules."; phone = lib.mkEnableOption "phone modules."; router = lib.mkEnableOption "router modules."; server = lib.mkEnableOption "server modules.";