Moved all nix configs
This commit is contained in:
1 parent
ad7fdad2c6
commit
1fcffc0650
6 files changed
+61
-82
No files matched your search
+20
-6
@@ -16,14 +16,9 @@
|
||||
, localNixCaches ? { keys = [ ]; urls = [ ]; }
|
||||
, ...
|
||||
}:
|
||||
{ ... }: {
|
||||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
(import ./skyg)
|
||||
(import ./nix {
|
||||
user = user;
|
||||
systemStateVersion = systemStateVersion;
|
||||
localNixCaches = localNixCaches;
|
||||
})
|
||||
] ++ (if desktop.enable then
|
||||
[ (import ./desktop ({ user = user; } // desktop)) ]
|
||||
else
|
||||
@@ -40,6 +35,25 @@
|
||||
++ (if enableHomelabServices then [ (import ./hl-services) ] else [ ])
|
||||
++ (if enableHomelabServices then [ (import ./hl-hardware) ] else [ ])
|
||||
;
|
||||
# Share defaults
|
||||
skyg.user = user;
|
||||
skyg.home-manager.version = homeManagerVersion;
|
||||
skyg.core.substituters = localNixCaches;
|
||||
system.stateVersion = systemStateVersion;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings = {
|
||||
optimise.automatic = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
# System Packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# nix utils
|
||||
nix-index
|
||||
nil
|
||||
cachix
|
||||
nixpkgs-fmt
|
||||
nvd
|
||||
# shell tools
|
||||
wget
|
||||
];
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
{ user, systemStateVersion, localNixCaches ? { keys = [ ]; urls = [ ]; } }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
(import ./remote-builder.nix {
|
||||
user = user;
|
||||
})
|
||||
];
|
||||
# Nix core
|
||||
system.stateVersion = systemStateVersion;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://cache.flox.dev"
|
||||
"https://devenv.cachix.org"
|
||||
] ++ localNixCaches.urls;
|
||||
trusted-substituters = [
|
||||
"https://cache.flox.dev"
|
||||
"https://devenv.cachix.org"
|
||||
] ++ localNixCaches.urls;
|
||||
trusted-users = [ "root" user.name ];
|
||||
trusted-public-keys = [
|
||||
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
] ++ localNixCaches.keys;
|
||||
};
|
||||
|
||||
# System Packages
|
||||
programs.zsh.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
# nix utils
|
||||
nix-index
|
||||
nil
|
||||
cachix
|
||||
nixpkgs-fmt
|
||||
nix-serve
|
||||
nvd
|
||||
|
||||
# shell tools
|
||||
wget
|
||||
|
||||
];
|
||||
# Storage Optim
|
||||
nix.optimise.automatic = true;
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{ user }:
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
let cfg = config.homelab.nix.remote-builder;
|
||||
in {
|
||||
options = {
|
||||
homelab.nix.remote-builder = {
|
||||
enable = mkEnableOption
|
||||
"Enable Remote Local Builders";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
nix.buildMachines = [{
|
||||
hostName = "bigbox1.lab.internal";
|
||||
sshUser = user.name;
|
||||
system = "x86_64-linux";
|
||||
protocol = "ssh-ng";
|
||||
maxJobs = 4;
|
||||
speedFactor = 4;
|
||||
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||
mandatoryFeatures = [ ];
|
||||
}];
|
||||
nix.distributedBuilds = true;
|
||||
nix.extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -4,5 +4,6 @@
|
||||
./core.nix
|
||||
./user.nix
|
||||
./macos.nix
|
||||
./nix-substituters.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.skyg.core.substituters;
|
||||
skygUser = config.skyg.user;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
skyg.core.substituters = {
|
||||
urls = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
keys = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nix.settings.substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://cache.flox.dev"
|
||||
"https://devenv.cachix.org"
|
||||
] ++ cfg.urls;
|
||||
nix.settings.trusted-substituters = [
|
||||
"https://cache.flox.dev"
|
||||
"https://devenv.cachix.org"
|
||||
] ++ cfg.urls;
|
||||
nix.settings.trusted-public-keys = [
|
||||
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
|
||||
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||
] ++ cfg.keys;
|
||||
nix.settings.trusted-users = [ "root" skygUser.name ];
|
||||
};
|
||||
}
|
||||
@@ -40,6 +40,7 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.zsh.enable = true;
|
||||
home-manager.users.root = {
|
||||
home.stateVersion = cfg.home-manager.version;
|
||||
programs.git = {
|
||||
|
||||
Reference in new issue
Block a user