[nixos-configs-0ov] Extract shared NixOS/Darwin base config #8

Merged
johno merged 1 commits from bead/nixos-configs-0ov into main 2026-01-10 11:45:01 -08:00
3 changed files with 43 additions and 78 deletions
Showing only changes of commit 3b10b2f7f2 - Show all commits

35
roles/common.nix Normal file
View File

@@ -0,0 +1,35 @@
# Common configuration shared between NixOS and Darwin
{ lib, pkgs, ... }:
{
config = {
time.timeZone = "America/Los_Angeles";
environment.systemPackages = with pkgs; [
git
glances
pciutils
tree
usbutils
vim
];
nix = {
package = pkgs.nix;
settings = {
experimental-features = [ "nix-command" "flakes" ];
max-jobs = "auto";
trusted-users = [ "johno" ];
substituters = [
];
};
gc = {
automatic = true;
options = "--delete-older-than 10d";
};
};
nixpkgs.config.allowUnfree = true;
};
}

View File

@@ -7,6 +7,10 @@ let
setEnvironmentPath = "${config.system.build.setEnvironment}"; setEnvironmentPath = "${config.system.build.setEnvironment}";
in in
{ {
imports = [
./common.nix
];
config = { config = {
# Salt manages /etc/bashrc, /etc/zshrc, /etc/zshenv # Salt manages /etc/bashrc, /etc/zshrc, /etc/zshenv
# nix-darwin writes to .local variants for nix-specific configuration # nix-darwin writes to .local variants for nix-specific configuration
@@ -43,8 +47,6 @@ in
fi fi
''; '';
time.timeZone = "America/Los_Angeles";
# System preferences # System preferences
system.defaults = { system.defaults = {
# Custom keyboard shortcuts # Custom keyboard shortcuts
@@ -79,42 +81,5 @@ in
}; };
}; };
}; };
environment.systemPackages = with pkgs; [
git
glances
pciutils
tree
usbutils
vim
];
nix = {
package = pkgs.nix;
# distributedBuilds = true;
# buildMachines = [{
# hostName = "z790prors.oglehome";
# system = "x86_64-linux";
# protocol = "ssh-ng";
# sshUser = "johno";
# sshKey = "/root/.ssh/id_ed25519";
# maxJobs = 3;
# speedFactor = 2;
# }];
settings = {
experimental-features = [ "nix-command" "flakes" ];
max-jobs = "auto";
trusted-users = [ "johno" ];
substituters = [
];
};
gc = {
automatic = true;
options = "--delete-older-than 10d";
};
};
nixpkgs.config.allowUnfree = true;
}; };
} }

View File

@@ -4,6 +4,7 @@ with lib;
{ {
imports = [ imports = [
./common.nix
./audio ./audio
./bluetooth ./bluetooth
./btrfs ./btrfs
@@ -31,7 +32,6 @@ with lib;
LC_TELEPHONE = "en_US.UTF-8"; LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8"; LC_TIME = "en_US.UTF-8";
}; };
time.timeZone = "America/Los_Angeles";
services.xserver.xkb = { services.xserver.xkb = {
layout = "us"; layout = "us";
@@ -49,42 +49,7 @@ with lib;
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
environment.systemPackages = with pkgs; [ # NixOS-specific gc option (not available on Darwin)
git nix.gc.randomizedDelaySec = "14m";
glances
pciutils
tree
usbutils
vim
];
nix = {
package = pkgs.nix;
# distributedBuilds = true;
# buildMachines = [{
# hostName = "z790prors.oglehome";
# system = "x86_64-linux";
# protocol = "ssh-ng";
# sshUser = "johno";
# sshKey = "/root/.ssh/id_ed25519";
# maxJobs = 3;
# speedFactor = 2;
# }];
settings = {
experimental-features = [ "nix-command" "flakes" ];
max-jobs = "auto";
trusted-users = [ "johno" ];
substituters = [
];
};
gc = {
automatic = true;
randomizedDelaySec = "14m";
options = "--delete-older-than 10d";
};
};
nixpkgs.config.allowUnfree = true;
}; };
} }