diff --git a/flake.nix b/flake.nix index 2fb2c94..e3f57cc 100644 --- a/flake.nix +++ b/flake.nix @@ -204,6 +204,24 @@ ./machines/terebithia ]; }; + + iso-x86_64 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + unstable-overlays + ./machines/iso + ]; + }; + + iso-aarch64 = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + specialArgs = { inherit inputs outputs; }; + modules = [ + unstable-overlays + ./machines/iso + ]; + }; }; # Standalone home-manager configurations @@ -298,6 +316,9 @@ x86_64-linux.docs = mkDocs "x86_64-linux"; aarch64-linux.docs = mkDocs "aarch64-linux"; aarch64-darwin.docs = mkDocs "aarch64-darwin"; + + x86_64-linux.iso = self.nixosConfigurations.iso-x86_64.config.system.build.isoImage; + aarch64-linux.iso = self.nixosConfigurations.iso-aarch64.config.system.build.isoImage; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree; diff --git a/machines/iso/default.nix b/machines/iso/default.nix new file mode 100644 index 0000000..fbaa880 --- /dev/null +++ b/machines/iso/default.nix @@ -0,0 +1,58 @@ +{ + pkgs, + lib, + inputs, + outputs, + modulesPath, + ... +}: +{ + imports = [ + "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" + inputs.home-manager.nixosModules.home-manager + ]; + + networking.hostName = "iso"; + + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "yes"; + PasswordAuthentication = false; + }; + }; + + home-manager = { + useGlobalPkgs = true; + extraSpecialArgs = { inherit inputs outputs; }; + users.root = { + imports = [ (inputs.import-tree ../../modules/home) ]; + + home = { + username = "root"; + homeDirectory = "/root"; + }; + + atelier.shell = { + enable = true; + ephemeral = true; + }; + + programs.home-manager.enable = true; + home.stateVersion = lib.trivial.release; + }; + }; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzEEjvbL/ttqmYoDjxYQmDIq36BabROJoXgQKeh9liBxApwp+2PmgxROzTg42UrRc9pyrkq5kVfxG5hvkqCinhL1fMiowCSEs2L2/Cwi40g5ZU+QwdcwI8a4969kkI46PyB19RHkxg54OUORiIiso/WHGmqQsP+5wbV0+4riSnxwn/JXN4pmnE//stnyAyoiEZkPvBtwJjKb3Ni9n3eNLNs6gnaXrCtaygEZdebikr9kS2g9mM696HvIFgM6cdR/wZ7DcLbG3IdTXuHN7PC3xxL+Y4ek5iMreQIPmuvs4qslbthPGYoYbYLUQiRa9XO5s/ksIj5Z14f7anHE6cuTQVpvNWdGDOigyIVS5qU+4ZF7j+rifzOXVL48gmcAvw/uV68m5Wl/p0qsC/d8vI3GYwEsWG/EzpAlc07l8BU2LxWgN+d7uwBFaJV9VtmUDs5dcslsh8IbzmtC9gq3OLGjklxTfIl6qPiL8U33oc/UwqzvZUrI2BlbagvIZYy6rP+q0= kierank@mockingjay" + ]; + + environment.systemPackages = with pkgs; [ + git + jq + curl + vim + ]; + + system.stateVersion = lib.trivial.release; +} diff --git a/modules/home/system/shell.nix b/modules/home/system/shell.nix index bf3376c..150ddb7 100644 --- a/modules/home/system/shell.nix +++ b/modules/home/system/shell.nix @@ -985,6 +985,12 @@ in options.atelier.shell = { enable = lib.mkEnableOption "Custom shell config"; + ephemeral = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Mark this as an ephemeral environment (red prompt)"; + }; + tangled = { plcId = lib.mkOption { type = lib.types.str; @@ -1054,7 +1060,7 @@ in type = "path"; style = "plain"; background = "transparent"; - foreground = "blue"; + foreground = if cfg.ephemeral then "red" else "blue"; template = "{{ .Path }} "; properties = { style = "full";