From a1fde92ec3d7dd0d54ae63bd81afeeb9109d6457 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 18 Jan 2025 21:20:02 +0300 Subject: [PATCH] Package: Add all target. --- Makefile | 10 +++++----- config/Live.nix | 11 +---------- host/x86_64-linux/dasha/default.nix | 2 +- host/x86_64-linux/desktop/default.nix | 2 +- host/x86_64-linux/installer/default.nix | 25 +++++++++++++++---------- host/x86_64-linux/live/default.nix | 23 +++++++++++++++++++++++ host/x86_64-linux/max/default.nix | 2 +- option/Package.nix | 16 ++++++++++------ 8 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 host/x86_64-linux/live/default.nix diff --git a/Makefile b/Makefile index 0a6d026..5514325 100644 --- a/Makefile +++ b/Makefile @@ -59,17 +59,17 @@ installer: .PHONY: live live: 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 reboot: boot reboot +.PHONY: recovery +recovery: + nix build -o installer $(options) $(flake)#nixosConfigurations.recovery.config.system.build.isoImage + + show: nix flake show diff --git a/config/Live.nix b/config/Live.nix index 187ecbc..ed98e9a 100644 --- a/config/Live.nix +++ b/config/Live.nix @@ -5,17 +5,8 @@ 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" + "${inputs.nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.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/dasha/default.nix b/host/x86_64-linux/dasha/default.nix index 7858032..389fc61 100644 --- a/host/x86_64-linux/dasha/default.nix +++ b/host/x86_64-linux/dasha/default.nix @@ -10,7 +10,7 @@ amd.gpu.enable = true; builder.client.enable = true; display.primary = "DP-1"; - package.extra = true; + package.all = true; print.enable = true; purpose = { creative = true; diff --git a/host/x86_64-linux/desktop/default.nix b/host/x86_64-linux/desktop/default.nix index 960209e..360f865 100644 --- a/host/x86_64-linux/desktop/default.nix +++ b/host/x86_64-linux/desktop/default.nix @@ -8,7 +8,7 @@ module = { builder.client.enable = true; - package.extra = true; + package.all = true; print.enable = true; syncthing.enable = true; purpose = { diff --git a/host/x86_64-linux/installer/default.nix b/host/x86_64-linux/installer/default.nix index 3ea7774..c60de07 100644 --- a/host/x86_64-linux/installer/default.nix +++ b/host/x86_64-linux/installer/default.nix @@ -1,22 +1,27 @@ -{ ... }: +{ 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; module = { keyd.enable = true; + package.all = 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 new file mode 100644 index 0000000..a61f040 --- /dev/null +++ b/host/x86_64-linux/live/default.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + # 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/max/default.nix b/host/x86_64-linux/max/default.nix index dcfe911..f0828a6 100644 --- a/host/x86_64-linux/max/default.nix +++ b/host/x86_64-linux/max/default.nix @@ -9,7 +9,7 @@ module = { builder.client.enable = true; - package.extra = true; + package.all = true; print.enable = true; syncthing.enable = true; purpose = { diff --git a/option/Package.nix b/option/Package.nix index 383f943..56a10e3 100644 --- a/option/Package.nix +++ b/option/Package.nix @@ -1,27 +1,31 @@ { lib, config, ... }: let + cfg = config.module.package; purpose = config.module.purpose; in { options.module.package = { + all = lib.mkEnableOption "All apps."; core = lib.mkEnableOption "Core apps." // { default = true; }; common = lib.mkEnableOption "Common Apps." // { - default = with purpose; desktop || laptop; + default = cfg.all || (with purpose; desktop || laptop); }; creative = lib.mkEnableOption "Creative Apps." // { - default = purpose.creative; + default = cfg.all || purpose.creative; }; desktop = lib.mkEnableOption "Desktop Apps." // { - default = with purpose; desktop || laptop; + default = cfg.all || (with purpose; desktop || laptop); }; dev = lib.mkEnableOption "Dev Apps." // { - default = purpose.work; + default = cfg.all || purpose.work; }; gaming = lib.mkEnableOption "Gaming Apps." // { - default = purpose.gaming; + default = cfg.all || purpose.gaming; + }; + extra = lib.mkEnableOption "Extra Apps." // { + default = cfg.all; }; - extra = lib.mkEnableOption "Extra Apps."; }; }