nixos: move nh to workstation
This commit is contained in:
parent
27a9e04281
commit
018e2e7bad
2 changed files with 22 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
inputs',
|
||||||
inputs,
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
|
@ -7,7 +8,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrValues;
|
inherit (builtins) attrValues;
|
||||||
inherit (lib) mkIf mapAttrsToList;
|
inherit (lib) mkIf mapAttrsToList;
|
||||||
inherit (config.ooknet.host) admin;
|
inherit (config.ooknet.host) role admin;
|
||||||
in {
|
in {
|
||||||
environment = {
|
environment = {
|
||||||
# disable default nix packages
|
# disable default nix packages
|
||||||
|
|
@ -15,11 +16,21 @@ in {
|
||||||
defaultPackages = [];
|
defaultPackages = [];
|
||||||
systemPackages = attrValues {
|
systemPackages = attrValues {
|
||||||
inherit (pkgs) git deadnix statix;
|
inherit (pkgs) git deadnix statix;
|
||||||
inherit (inputs.agenix.packages.${pkgs.system}) default;
|
inherit (inputs'.agenix.packages) default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# location of the configuration flake
|
||||||
|
variables.FLAKE = "/home/${admin.name}/.config/ooknet";
|
||||||
};
|
};
|
||||||
nix = {
|
nix = {
|
||||||
# package = pkgs.lix;
|
# package = pkgs.lix;
|
||||||
|
|
||||||
|
# collect garbage
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "Sun *-*-* 14:00";
|
||||||
|
options = "--delete-older-than 14d";
|
||||||
|
};
|
||||||
registry = {
|
registry = {
|
||||||
nixpkgs.flake = inputs.nixpkgs;
|
nixpkgs.flake = inputs.nixpkgs;
|
||||||
default.flake = inputs.nixpkgs;
|
default.flake = inputs.nixpkgs;
|
||||||
|
|
@ -56,14 +67,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
# nix rebuild utililty
|
# nix rebuild utililty
|
||||||
programs.nh = {
|
programs.nh = mkIf (role == "workstation") {
|
||||||
enable = true;
|
enable = true;
|
||||||
# sets an environment variable FLAKE that nh will refer to by default
|
# sets an environment variable FLAKE that nh will refer to by default
|
||||||
flake = mkIf admin.homeManager "/home/${admin.name}/.config/ooknet";
|
flake = mkIf admin.homeManager "/home/${admin.name}/.config/ooknet";
|
||||||
# garbage collect
|
|
||||||
clean = {
|
|
||||||
enable = true;
|
|
||||||
extraArgs = "--keep 5 --keep-since 14d";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
modules/nixos/workstation/programs/nh.nix
Normal file
8
modules/nixos/workstation/programs/nh.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{config, ...}: let
|
||||||
|
inherit (config.ooknet.host) admin;
|
||||||
|
in {
|
||||||
|
programs.nh = {
|
||||||
|
enable = true;
|
||||||
|
flake = "/home/${admin.name}/.config/ooknet";
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue