restructuring for new nix-home flake

This commit is contained in:
John Lancaster
2025-06-16 14:05:08 -05:00
parent 83db5f51ce
commit fbda875a6f
4 changed files with 124 additions and 104 deletions

73
flake.lock generated
View File

@@ -39,11 +39,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748875655, "lastModified": 1750097069,
"narHash": "sha256-13VVGRq/F4O+39qQzgfUoqn26lDbNtF5gYavAysXHiE=", "narHash": "sha256-MePLDJw4megMq47O3WXgmpnDOIaQrHYrgA3xS7Ps+c8=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "b5e62f9a9edfca90094041698626e14cacbcf72e", "rev": "ab8a1563714393d366b2db7d93f021afb45e7a6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -178,11 +178,32 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748830238, "lastModified": 1750099781,
"narHash": "sha256-EB+LzYHK0D5aqxZiYoPeoZoOzSAs8eqBDxm3R+6wMKU=", "narHash": "sha256-6EVPi3XzioPzwxLZ/2nD6jbKCLA2ZXRdOWFgHg2ozrA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c7fdb7e90bff1a51b79c1eed458fb39e6649a82a", "rev": "1db3cb415da14c81d8e0fdd3a5edeba82ad13a1f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nix-home",
"nixpkgs"
]
},
"locked": {
"lastModified": 1750033262,
"narHash": "sha256-TcFN78w6kPspxpbPsxW/8vQ1GAtY8Y3mjBaC+oB8jo4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "66523b0efe93ce5b0ba96dcddcda15d36673c1f0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -240,6 +261,27 @@
"type": "github" "type": "github"
} }
}, },
"nix-home": {
"inputs": {
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1750100488,
"narHash": "sha256-WFY6/1AtATVloT/takLMt6/0RNx2ivU1ZXG4Pn64/eA=",
"ref": "refs/heads/main",
"rev": "696f5a00078b39c9ca81802170924c4647ffd5a1",
"revCount": 16,
"type": "git",
"url": "https://gitea.john-stream.com/john/nix-home"
},
"original": {
"type": "git",
"url": "https://gitea.john-stream.com/john/nix-home"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733212471, "lastModified": 1733212471,
@@ -264,11 +306,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1746223523, "lastModified": 1749760516,
"narHash": "sha256-BH27BJZNbR0zQAL/mFCxDPR6K6mbrmjJ66lxVDTNPXU=", "narHash": "sha256-koLwnVjVrR4yS2ea1owMj6ps2sOhH67ObTIld9H27Yo=",
"owner": "cachix", "owner": "cachix",
"repo": "nixpkgs-python", "repo": "nixpkgs-python",
"rev": "3f5f1dbe0122a1741907aa5ab76f7337ffcd2ccb", "rev": "908dbb466af5955ea479ac95953333fd64387216",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -295,11 +337,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1748693115, "lastModified": 1749794982,
"narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", "narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", "rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -327,6 +369,7 @@
"inputs": { "inputs": {
"devenv": "devenv", "devenv": "devenv",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-home": "nix-home",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgs-python": "nixpkgs-python", "nixpkgs-python": "nixpkgs-python",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
@@ -340,11 +383,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747603214, "lastModified": 1749592509,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", "narHash": "sha256-VunQzfZFA+Y6x3wYi2UE4DEQ8qKoAZZCnZPUlSoqC+A=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", "rev": "50754dfaa0e24e313c626900d44ef431f3210138",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -18,6 +18,10 @@
url = "github:cachix/devenv"; url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nix-home = {
url = "git+https://gitea.john-stream.com/john/nix-home";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
nixConfig = { nixConfig = {
@@ -25,10 +29,10 @@
extra-substituters = "https://devenv.cachix.org"; extra-substituters = "https://devenv.cachix.org";
}; };
outputs = { self, ... }@args: outputs = { self, ... }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
nixosSystem = args.nixpkgs.lib.nixosSystem; nixosSystem = inputs.nixpkgs.lib.nixosSystem;
userSettings = { userSettings = {
gitUserName = "John Lancaster"; gitUserName = "John Lancaster";
@@ -46,26 +50,23 @@
# pythonVersion = "3.11.10"; # This is largely irrelevant because uv will handle it # pythonVersion = "3.11.10"; # This is largely irrelevant because uv will handle it
}; };
pkgs = args.nixpkgs.legacyPackages.${systemSettings.system}; pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
in in
{ {
nixosConfigurations.${systemSettings.hostName} = nixosSystem { nixosConfigurations.${systemSettings.hostName} = nixosSystem {
system = systemSettings.system; system = systemSettings.system;
specialArgs = specialArgs = {
let
inputs = args;
in
{
inherit inputs; inherit inputs;
inherit systemSettings; inherit systemSettings;
inherit userSettings; inherit userSettings;
}; };
modules = [ modules = [
(args.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix") (inputs.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
args.home-manager.nixosModules.default inputs.home-manager.nixosModules.default
args.vscode-server.nixosModules.default inputs.nix-home.nixosModules.default { user = "appdaemon"; }
args.sops-nix.nixosModules.sops inputs.vscode-server.nixosModules.default
inputs.sops-nix.nixosModules.sops
./configuration.nix ./configuration.nix
]; ];
}; };
@@ -76,11 +77,7 @@
devenv-test = self.devShells.${systemSettings.system}.default.config.test; devenv-test = self.devShells.${systemSettings.system}.default.config.test;
}; };
devShells.${systemSettings.system}.default = devShells.${systemSettings.system}.default = inputs.devenv.lib.mkShell {
let
inputs = args;
in
args.devenv.lib.mkShell {
inherit inputs pkgs; inherit inputs pkgs;
modules = [ modules = [
({ pkgs, config, ... }: { ({ pkgs, config, ... }: {

View File

@@ -9,28 +9,16 @@
users.users.${userSettings.userName} = { users.users.${userSettings.userName} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" ]; extraGroups = [ "wheel" "docker" ];
openssh.authorizedKeys.keyFiles = [ ../secrets/authorized_keys ];
shell = "${pkgs.zsh}/bin/zsh";
}; };
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
users.${userSettings.userName} = { ... }: { users.${userSettings.userName} = {
home.stateVersion = systemSettings.stateVersion; home.stateVersion = systemSettings.stateVersion;
home.homeDirectory = lib.mkForce "${userSettings.adHome}"; home.homeDirectory = lib.mkForce "${userSettings.adHome}";
systemd.user.startServices = "sd-switch"; # helps with handling systemd services when switching systemd.user.startServices = "sd-switch"; # helps with handling systemd services when switching
imports = [ programs.ssh.enable = true;
(import ./zsh.nix) programs.gh.enable = true;
(import ./git.nix {inherit userSettings;})
];
home.packages = with pkgs; [
# Add any additional packages you want to install in your home directory
superfile
];
programs = {
ssh.enable = true;
gh.enable = true;
};
}; };
}; };
} }

View File

@@ -1,17 +1,9 @@
{ pkgs, systemSettings, ... }: { pkgs, systemSettings, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${systemSettings.hostName} --impure
'')
(pkgs.writeShellScriptBin "nfsu" ''
FLAKE=$(readlink -f /etc/nixos)
nix flake update --flake $FLAKE --impure
git -C $FLAKE add "$FLAKE/flake.lock" > /dev/null 2>&1
sudo nixos-rebuild switch --flake $FLAKE#${systemSettings.hostName} --impure
'')
(pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)") (pkgs.writeShellScriptBin "ads" "nix develop --no-pure-eval $(readlink -f /etc/nixos)")
(pkgs.writeShellScriptBin "link-nix" "${builtins.readFile ./link-nix.sh}") (pkgs.writeShellScriptBin "link-nix" "${builtins.readFile ./link-nix.sh}")
(pkgs.writeShellScriptBin "sops-ad" "sops $(readlink -f /etc/nixos)/secrets/encrypted_secrets.yaml") (pkgs.writeShellScriptBin "sops-ad" "sops $(readlink -f /etc/nixos)/secrets/encrypted_secrets.yaml")
(pkgs.writeShellScriptBin "lola-up" "docker compose -f /conf/lola/docker-compose.yml up -d")
]; ];
} }