restructuring for new nix-home flake
This commit is contained in:
73
flake.lock
generated
73
flake.lock
generated
@@ -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": {
|
||||||
|
|||||||
127
flake.nix
127
flake.nix
@@ -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,71 +77,67 @@
|
|||||||
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
|
inherit inputs pkgs;
|
||||||
inputs = args;
|
modules = [
|
||||||
in
|
({ pkgs, config, ... }: {
|
||||||
args.devenv.lib.mkShell {
|
# This is your devenv configuration
|
||||||
inherit inputs pkgs;
|
|
||||||
modules = [
|
|
||||||
({ pkgs, config, ... }: {
|
|
||||||
# This is your devenv configuration
|
|
||||||
|
|
||||||
# https://devenv.sh/reference/options/#pre-commithooks
|
# https://devenv.sh/reference/options/#pre-commithooks
|
||||||
git-hooks.hooks = {
|
git-hooks.hooks = {
|
||||||
end-of-file-fixer.enable = true;
|
end-of-file-fixer.enable = true;
|
||||||
trim-trailing-whitespace.enable = true;
|
trim-trailing-whitespace.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://devenv.sh/supported-languages/python/
|
# https://devenv.sh/supported-languages/python/
|
||||||
languages.python = {
|
languages.python = {
|
||||||
|
enable = true;
|
||||||
|
# version = systemSettings.pythonVersion;
|
||||||
|
uv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# version = systemSettings.pythonVersion;
|
package = pkgs.uv;
|
||||||
uv = {
|
sync = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.uv;
|
allExtras = true;
|
||||||
sync = {
|
arguments = [ "-U" ];
|
||||||
enable = true;
|
|
||||||
allExtras = true;
|
|
||||||
arguments = [ "-U" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
git
|
git
|
||||||
|
gdbm
|
||||||
|
# (python312.withPackages (python-pkgs: with python-pkgs; [ gdbm ]))
|
||||||
|
(python312.withPackages (python-pkgs: with python-pkgs; [
|
||||||
gdbm
|
gdbm
|
||||||
# (python312.withPackages (python-pkgs: with python-pkgs; [ gdbm ]))
|
notebook # kinda hacky, but needed so that jupyter notebook has some shared library it needs?
|
||||||
(python312.withPackages (python-pkgs: with python-pkgs; [
|
]))
|
||||||
gdbm
|
(writeShellScriptBin "docs" "${pkgs.uv}/bin/uv run sphinx-autobuild -E ./docs/ ./docs_build --port 9999")
|
||||||
notebook # kinda hacky, but needed so that jupyter notebook has some shared library it needs?
|
(writeShellScriptBin "ab" "${pkgs.uv}/bin/uv build --wheel --refresh")
|
||||||
]))
|
(writeShellScriptBin "adb" "ab && ${pkgs.docker}/bin/docker build -t acockburn/appdaemon:local-dev .")
|
||||||
(writeShellScriptBin "docs" "${pkgs.uv}/bin/uv run sphinx-autobuild -E ./docs/ ./docs_build --port 9999")
|
# (writeShellScriptBin "ad-nb" "cd $(readlink -f /etc/nixos) && devenv up")
|
||||||
(writeShellScriptBin "ab" "${pkgs.uv}/bin/uv build --wheel --refresh")
|
];
|
||||||
(writeShellScriptBin "adb" "ab && ${pkgs.docker}/bin/docker build -t acockburn/appdaemon:local-dev .")
|
|
||||||
# (writeShellScriptBin "ad-nb" "cd $(readlink -f /etc/nixos) && devenv up")
|
|
||||||
];
|
|
||||||
|
|
||||||
# processes = {
|
# processes = {
|
||||||
# my-jup.exec = "uv run jupyter notebook";
|
# my-jup.exec = "uv run jupyter notebook";
|
||||||
# };
|
# };
|
||||||
|
|
||||||
enterShell = ''
|
enterShell = ''
|
||||||
alias fix="${pkgs.uv}/bin/uv run ruff check --fix"
|
alias fix="${pkgs.uv}/bin/uv run ruff check --fix"
|
||||||
alias appdaemon="${pkgs.uv}/bin/uv run --frozen appdaemon"
|
alias appdaemon="${pkgs.uv}/bin/uv run --frozen appdaemon"
|
||||||
# alias ad="appdaemon"
|
# alias ad="appdaemon"
|
||||||
|
|
||||||
export PS1="\[\e[0;34m\](AppDaemon)\[\e[0m\] \[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] "
|
export PS1="\[\e[0;34m\](AppDaemon)\[\e[0m\] \[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$\[\033[0m\] "
|
||||||
|
|
||||||
export VIRTUAL_ENV=$UV_PROJECT_ENVIRONMENT
|
export VIRTUAL_ENV=$UV_PROJECT_ENVIRONMENT
|
||||||
|
|
||||||
echo -e "URL: \e[34m$(${pkgs.git}/bin/git config --get remote.origin.url)\e[0m"
|
echo -e "URL: \e[34m$(${pkgs.git}/bin/git config --get remote.origin.url)\e[0m"
|
||||||
echo -e "Branch/Tag: \e[32m$(${pkgs.git}/bin/git describe --tags --exact-match 2>/dev/null || ${pkgs.git}/bin/git rev-parse --abbrev-ref HEAD)\e[0m"
|
echo -e "Branch/Tag: \e[32m$(${pkgs.git}/bin/git describe --tags --exact-match 2>/dev/null || ${pkgs.git}/bin/git rev-parse --abbrev-ref HEAD)\e[0m"
|
||||||
echo -e "Hash: \e[33m$(${pkgs.git}/bin/git rev-parse --short HEAD)\e[0m"
|
echo -e "Hash: \e[33m$(${pkgs.git}/bin/git rev-parse --short HEAD)\e[0m"
|
||||||
echo "AppDaemon v$(${pkgs.uv}/bin/uv pip show appdaemon | awk '/^Version:/ {print $2}') development shell started"
|
echo "AppDaemon v$(${pkgs.uv}/bin/uv pip show appdaemon | awk '/^Version:/ {print $2}') development shell started"
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -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;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user