diff --git a/devshell/commands.nix b/devshell/commands.nix index 0e18261..20d3b77 100644 --- a/devshell/commands.nix +++ b/devshell/commands.nix @@ -48,5 +48,33 @@ in help = "Run `home-manager switch`"; command = ''home-manager switch --flake . "$@"''; } + { + name = "build-system"; + category = "tasks"; + help = "Build NixOS configuration"; + command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.system.build.toplevel"''; + } + { + name = "run-vm"; + category = "tasks"; + help = "Run NixOS configuration as a VM"; + command = + '' + cd "$PRJ_ROOT" + nix run ".#nixosConfigurations.\"$1\".config.my.buildAs.devVM" + ''; + } + { + name = "build-iso"; + category = "tasks"; + help = "Build NixOS configuration into an ISO"; + command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.my.buildAs.iso"''; + } + { + name = "build-home"; + category = "tasks"; + help = "Build home-manager configuration"; + command = ''nix build "''${@:2}" ".#homeConfigurations.\"$1\".activationPackage"''; + } ]; } diff --git a/flake.nix b/flake.nix index 3da2c81..3e7e962 100644 --- a/flake.nix +++ b/flake.nix @@ -113,23 +113,18 @@ nixosModules = inlineModules modules; homeModules = inlineModules homeModules; - # TODO: Cleanup and possibly even turn into modules? nixosConfigurations = import ./nixos { inherit lib pkgsFlakes hmFlakes inputs; pkgs' = configPkgs'; modules = attrValues modules; homeModules = attrValues homeModules; }; - systems = mapAttrs (_: system: system.config.system.build.toplevel) self.nixosConfigurations; - vms = mapAttrs (_: system: system.config.my.buildAs.devVM) self.nixosConfigurations; - isos = mapAttrs (_: system: system.config.my.buildAs.iso) self.nixosConfigurations; homeConfigurations = import ./home-manager { inherit lib hmFlakes inputs; pkgs' = configPkgs'; modules = attrValues homeModules; }; - homes = mapAttrs (_: home: home.activationPackage) self.homeConfigurations; deploy = { nodes = filterAttrs (_: n: n != null) diff --git a/nixos/installer.nix b/nixos/installer.nix index e299c00..52b2c37 100644 --- a/nixos/installer.nix +++ b/nixos/installer.nix @@ -17,9 +17,10 @@ in # Whatever installer mechanism is chosen will provied an appropriate `/` tmproot.enable = false; firewall.nat.enable = false; - server.enable = true; deploy.enable = false; user.enable = false; + + server.enable = true; }; environment.sessionVariables = {