From 6e6226675e190749b4134d10243061ade755f08a Mon Sep 17 00:00:00 2001 From: Whovian9369 Date: Sun, 28 Jul 2024 00:55:20 -0400 Subject: [PATCH] Update `aaru` input. --- flake.nix | 55 ++++++++++++++++++++++++++++ system/my_nixos_vm/configuration.nix | 44 ++++++++++++++++++++++ system/my_nixos_vm/packages.nix | 30 +++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 system/my_nixos_vm/configuration.nix create mode 100644 system/my_nixos_vm/packages.nix diff --git a/flake.nix b/flake.nix index ceda286..85227fb 100644 --- a/flake.nix +++ b/flake.nix @@ -286,6 +286,61 @@ ]; }; + my_nixos_vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./system/my_nixos_vm/configuration.nix + # ./system/dotnet_os_codename-workaround.nix + # Source of this fix file is + # https://github.com/nazarewk-iac/nix-configs + # /modules/ascii-workaround.nix + ./system/nix_lix.nix + ./system/users.nix + lix-module.nixosModules.default + home-manager.nixosModules.home-manager + { + system.configurationRevision = self.shortRev or self.dirtyShortRev or "dirty"; + + users.users.whovian = { + openssh.authorizedKeys.keys = mySSHKeys; + }; + + environment.shells = [ + pkgs.zsh + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + users = { + whovian = { + imports = [ + ./home/home.nix + agenix.homeManagerModules.default + nix-index-database.hmModules.nix-index + ]; + }; + }; + + # Optionally, use home-manager.extraSpecialArgs to pass arguments + # to home.nix + extraSpecialArgs = { + system = "x86_64-linux"; + inherit aaru; + inherit xil; + inherit nixpkgs; + pkgs = import nixpkgs { + system = "x86_64-linux"; + config.allowUnfree = true; + }; + inherit agenix; + }; + }; + } + ]; + }; + /* nixps = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; diff --git a/system/my_nixos_vm/configuration.nix b/system/my_nixos_vm/configuration.nix new file mode 100644 index 0000000..4127d9d --- /dev/null +++ b/system/my_nixos_vm/configuration.nix @@ -0,0 +1,44 @@ +{ + lib, + pkgs, + config, + modulesPath, + ... +}: + +{ + imports = [ + ./packages.nix + ]; + + networking.hostName = "my_nixos_vm"; + + # Enable nix flakes + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + time.timeZone = "America/New_York"; + + /* + Add environment.pathsToLink for auto-completion for system packages (e.g. systemd). + Appears to be required due to [GitHub - nix-community/home-manager]: + https://github.com/nix-community/home-manager/blob/c781b28add41b74423ab2e64496d4fc91192e13a/modules/programs/zsh.nix#L348-L358 + [/modules/programs/zsh.nix] + https://github.com/nix-community/home-manager/issues/3521#issuecomment-1367197995 + [Issue #3521] + + 06 June 2024: + Appears to be handled by "programs.zsh.enableCompletion" being enabled. + https://github.com/NixOS/nixpkgs/blob/49f6869f71fb2724674ccc18670bbde70843d43f/nixos/modules/programs/zsh/zsh.nix#L305 + I appear to have "programs.zsh.enableCompletion" disabled for some reason? + Need to look into this again at some point, I suppose. + */ + + environment.pathsToLink = [ + "/share/zsh" + ]; + + system.stateVersion = "22.05"; +} diff --git a/system/my_nixos_vm/packages.nix b/system/my_nixos_vm/packages.nix new file mode 100644 index 0000000..0c45268 --- /dev/null +++ b/system/my_nixos_vm/packages.nix @@ -0,0 +1,30 @@ +{ lib, agenix, pkgs, config, modulesPath, ... }: +{ + environment.systemPackages = [ + pkgs.file + pkgs.xterm + # `agenix` is currently added via + # home-manager's `home.packages` + ]; + + + nixpkgs = { + config = { + allowUnfree = true; + }; + }; + + programs = { + zsh = { + enable = true; + }; + nano = { + enable = true; + }; + + screen = { + enable = true; + }; + + }; +}