♻️ consolidate nix configs
This commit is contained in:
39
nix/modules/base/common.nix
Normal file
39
nix/modules/base/common.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
dogdns
|
||||
htop
|
||||
inetutils
|
||||
vim
|
||||
];
|
||||
|
||||
nix = {
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'';
|
||||
|
||||
gc = {
|
||||
automatic = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://walkah.cachix.org"
|
||||
"https://cache.garnix.io"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"walkah.cachix.org-1:D8cO78JoJC6UPV1ZMgd1V5znpk3jNUERGIeAKN15hxo="
|
||||
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
promptInit = "";
|
||||
};
|
||||
};
|
||||
}
|
57
nix/modules/base/darwin.nix
Normal file
57
nix/modules/base/darwin.nix
Normal file
@ -0,0 +1,57 @@
|
||||
{ pkgs, dotfiles, ... }: {
|
||||
|
||||
imports = [ ./common.nix ];
|
||||
|
||||
nix = {
|
||||
configureBuildUsers = true;
|
||||
|
||||
extraOptions = ''
|
||||
extra-platforms = x86_64-darwin aarch64-darwin
|
||||
'';
|
||||
|
||||
gc = {
|
||||
interval = {
|
||||
Hour = 3;
|
||||
Minute = 16;
|
||||
Weekday = 6;
|
||||
};
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
settings = {
|
||||
trusted-users = [ "root" "@admin" ];
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"sudoers.d/walkah".text = ''
|
||||
walkah ALL = (ALL) NOPASSWD: ALL
|
||||
'';
|
||||
};
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
brewPrefix = "/opt/homebrew/bin";
|
||||
global = {
|
||||
brewfile = true;
|
||||
lockfiles = false;
|
||||
};
|
||||
onActivation = {
|
||||
autoUpdate = true;
|
||||
cleanup = "zap";
|
||||
upgrade = true;
|
||||
};
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.walkah = import "${dotfiles}/home.nix";
|
||||
};
|
||||
|
||||
users.users.walkah = {
|
||||
home = "/Users/walkah";
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
|
||||
system.stateVersion = 4;
|
||||
}
|
37
nix/modules/base/nixos.nix
Normal file
37
nix/modules/base/nixos.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{ config, ... }: {
|
||||
|
||||
imports = [ ./common.nix ../monitoring ];
|
||||
|
||||
nix = {
|
||||
gc = {
|
||||
persistent = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
|
||||
trusted-users = [ "root" "walkah" ];
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
mosh.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
tailscale.enable = true;
|
||||
};
|
||||
|
||||
system = {
|
||||
autoUpgrade = {
|
||||
enable = true;
|
||||
flake = "github:walkah/athens#${config.networking.hostName}";
|
||||
dates = "daily";
|
||||
randomizedDelaySec = "5m";
|
||||
};
|
||||
stateVersion = "23.05";
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user