Refactor back to a more modular configuration
This commit is contained in:
parent
19ea08a716
commit
2bedd41d83
178 changed files with 2245 additions and 1847 deletions
|
@ -1,37 +1,21 @@
|
|||
{ inputs, username, ... }:
|
||||
|
||||
let
|
||||
git = {
|
||||
name = "Oliver Davies";
|
||||
emailAddress = "oliver.davies@tfw.wales";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = with inputs.self.nixosModules; [
|
||||
editor-nvim
|
||||
mixins-common
|
||||
mixins-direnv
|
||||
mixins-docker
|
||||
mixins-fzf
|
||||
mixins-node
|
||||
mixins-notes
|
||||
mixins-phpactor
|
||||
mixins-ranger
|
||||
mixins-scripts
|
||||
mixins-starship
|
||||
mixins-tmux
|
||||
mixins-zsh
|
||||
imports = [
|
||||
../common
|
||||
|
||||
users-opdavies
|
||||
|
||||
(import ../../modules/mixins/git.nix { inherit git; })
|
||||
../../users/opdavies.nix
|
||||
|
||||
./modules/wiki.nix
|
||||
];
|
||||
|
||||
nixosModules = {
|
||||
cli = {
|
||||
docker.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
wsl = {
|
||||
enable = true;
|
||||
defaultUser = username;
|
||||
defaultUser = "opdavies";
|
||||
};
|
||||
|
||||
home-manager.users.opdavies.home.sessionVariables.WAYLAND_DISPLAY = "";
|
||||
|
|
122
hosts/common/default.nix
Normal file
122
hosts/common/default.nix
Normal file
|
@ -0,0 +1,122 @@
|
|||
{
|
||||
hostname,
|
||||
inputs,
|
||||
outputs,
|
||||
pkgs,
|
||||
self,
|
||||
stateVersion,
|
||||
system,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./users
|
||||
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
|
||||
outputs.nixosModules.default
|
||||
];
|
||||
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
|
||||
download-buffer-size = "104857600";
|
||||
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.defaultUserShell = pkgs.zsh;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
cryptsetup
|
||||
fastfetch
|
||||
mermaid-cli
|
||||
mkcert
|
||||
passmenu-otp
|
||||
|
||||
(pass.withExtensions (
|
||||
e: with e; [
|
||||
passExtensions.pass-audit
|
||||
passExtensions.pass-import
|
||||
passExtensions.pass-otp
|
||||
passExtensions.pass-update
|
||||
]
|
||||
))
|
||||
];
|
||||
|
||||
home-manager = {
|
||||
backupFileExtension = "backup";
|
||||
|
||||
extraSpecialArgs = {
|
||||
inherit
|
||||
hostname
|
||||
inputs
|
||||
outputs
|
||||
self
|
||||
system
|
||||
username
|
||||
;
|
||||
};
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
|
||||
users."${username}" = import ./home.nix;
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
|
||||
permittedInsecurePackages = [ "electron-27.3.11" ];
|
||||
};
|
||||
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.stable-packages
|
||||
];
|
||||
};
|
||||
|
||||
nix.extraOptions = ''
|
||||
trusted-users = root ${username}
|
||||
'';
|
||||
|
||||
networking.hostName = hostname;
|
||||
|
||||
time.timeZone = "Europe/London";
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_GB.UTF-8";
|
||||
LC_IDENTIFICATION = "en_GB.UTF-8";
|
||||
LC_MEASUREMENT = "en_GB.UTF-8";
|
||||
LC_MONETARY = "en_GB.UTF-8";
|
||||
LC_NAME = "en_GB.UTF-8";
|
||||
LC_NUMERIC = "en_GB.UTF-8";
|
||||
LC_PAPER = "en_GB.UTF-8";
|
||||
LC_TELEPHONE = "en_GB.UTF-8";
|
||||
LC_TIME = "en_GB.UTF-8";
|
||||
};
|
||||
};
|
||||
|
||||
console.keyMap = "uk";
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
system.stateVersion = stateVersion;
|
||||
}
|
108
hosts/common/home.nix
Normal file
108
hosts/common/home.nix
Normal file
|
@ -0,0 +1,108 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
outputs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
|
||||
config.allowUnfree = true;
|
||||
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.stable-packages
|
||||
];
|
||||
};
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
inherit (config.xdg)
|
||||
cacheHome
|
||||
configHome
|
||||
dataHome
|
||||
stateHome
|
||||
;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
outputs.homeManagerModules.default
|
||||
];
|
||||
|
||||
home.username = "opdavies";
|
||||
home.homeDirectory = "/home/${config.home.username}";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cachix
|
||||
delta
|
||||
entr
|
||||
gcc
|
||||
git
|
||||
git-crypt
|
||||
gnupg
|
||||
inotify-tools
|
||||
jq
|
||||
killall
|
||||
lua
|
||||
mob
|
||||
pv
|
||||
simple-http-server
|
||||
sshs
|
||||
tldr
|
||||
tree
|
||||
tree-sitter
|
||||
unzip
|
||||
w3m
|
||||
watchexec
|
||||
wget
|
||||
xclip
|
||||
xdg-utils
|
||||
zbar
|
||||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
IMAPFILTER_HOME = "${configHome}/imapfilter";
|
||||
LANG = "en_GB.UTF-8";
|
||||
LC_ALL = "en_GB.UTF-8";
|
||||
LC_CTYPE = "en_GB.UTF-8";
|
||||
PASSWORD_STORE_DIR = "${dataHome}/pass";
|
||||
PATH = lib.concatStringsSep ":" [
|
||||
"$PATH"
|
||||
"$HOME/go/bin"
|
||||
"./vendor/bin"
|
||||
"./node_modules/.bin"
|
||||
];
|
||||
PULUMI_SKIP_UPDATE_CHECK = "true";
|
||||
W3M_DIR = "${stateHome}/w3m";
|
||||
WGETRC = "${configHome}/wgetrc";
|
||||
XDG_CONFIG_HOME = config.xdg.configHome;
|
||||
XDG_DATA_HOME = dataHome;
|
||||
XDG_STATE_HOME = stateHome;
|
||||
};
|
||||
|
||||
xdg = {
|
||||
configFile = {
|
||||
"${config.home.sessionVariables.WGETRC}".text = ''
|
||||
hsts-file = "${cacheHome}/wget-hsts"
|
||||
'';
|
||||
};
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = {
|
||||
XDG_REPOS_DIR = "${config.home.homeDirectory}/Code";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Nicely reload system units when changing configs.
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
home.stateVersion = "22.05"; # Please read the comment before changing.
|
||||
}
|
5
hosts/common/users/default.nix
Normal file
5
hosts/common/users/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./opdavies.nix
|
||||
];
|
||||
}
|
7
hosts/common/users/opdavies.nix
Normal file
7
hosts/common/users/opdavies.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
users.users.opdavies = { };
|
||||
|
||||
home-manager.users.opdavies = import ../../../home/opdavies/${config.networking.hostName}.nix;
|
||||
}
|
|
@ -1,61 +1,20 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = with inputs.self.nixosModules; [
|
||||
imports = [
|
||||
../common
|
||||
./hardware-configuration.nix
|
||||
./programs.nix
|
||||
./services.nix
|
||||
|
||||
mixins-avahi
|
||||
mixins-bluetooth
|
||||
mixins-common
|
||||
mixins-zram
|
||||
mixins-zsh
|
||||
|
||||
users-opdavies
|
||||
users-eric
|
||||
../../users/opdavies.nix
|
||||
../../users/eric.nix
|
||||
];
|
||||
|
||||
services = {
|
||||
auto-cpufreq.enable = true;
|
||||
gvfs.enable = true;
|
||||
openssh.enable = true;
|
||||
power-profiles-daemon.enable = false;
|
||||
thermald.enable = true;
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
printing.enable = true;
|
||||
pulseaudio.enable = false;
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
|
||||
xkb = {
|
||||
layout = "gb";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
desktopManager.cinnamon.enable = true;
|
||||
displayManager.lightdm.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
firefox = {
|
||||
enable = true;
|
||||
languagePacks = [ "en-GB" ];
|
||||
preferences = {
|
||||
"intl.accept_languages" = "en-GB, en";
|
||||
"intl.regional_prefs.use_os_locales" = true;
|
||||
};
|
||||
nixosModules = {
|
||||
core = {
|
||||
bluetooth.enable = true;
|
||||
zram.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
13
hosts/lemp11/programs.nix
Normal file
13
hosts/lemp11/programs.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
programs = {
|
||||
firefox = {
|
||||
enable = true;
|
||||
|
||||
languagePacks = [ "en-GB" ];
|
||||
preferences = {
|
||||
"intl.accept_languages" = "en-GB, en";
|
||||
"intl.regional_prefs.use_os_locales" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
35
hosts/lemp11/services.nix
Normal file
35
hosts/lemp11/services.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
services = {
|
||||
auto-cpufreq.enable = true;
|
||||
gvfs.enable = true;
|
||||
openssh.enable = true;
|
||||
power-profiles-daemon.enable = false;
|
||||
thermald.enable = true;
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
|
||||
alsa = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
printing.enable = true;
|
||||
pulseaudio.enable = false;
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
|
||||
xkb = {
|
||||
layout = "gb";
|
||||
variant = "";
|
||||
};
|
||||
|
||||
desktopManager.cinnamon.enable = true;
|
||||
displayManager.lightdm.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -2,35 +2,21 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = with inputs.self.nixosModules; [
|
||||
imports = [
|
||||
../common
|
||||
./hardware-configuration.nix
|
||||
./modules
|
||||
./secrets.nix
|
||||
|
||||
mixins-avahi
|
||||
mixins-common
|
||||
mixins-fzf
|
||||
mixins-openssh
|
||||
mixins-podman
|
||||
mixins-starship
|
||||
mixins-zsh
|
||||
|
||||
users-opdavies
|
||||
|
||||
./modules/acme.nix
|
||||
./modules/audiobookshelf.nix
|
||||
./modules/cloudflared.nix
|
||||
./modules/containers
|
||||
./modules/forgejo.nix
|
||||
./modules/immich.nix
|
||||
./modules/jellyfin.nix
|
||||
./modules/nginx
|
||||
./modules/paperless.nix
|
||||
../../users/opdavies.nix
|
||||
];
|
||||
|
||||
programs.dconf.enable = true;
|
||||
nixosModules = {
|
||||
core.openssh.enable = true;
|
||||
cli.podman.enable = true;
|
||||
desktop.dconf.enable = true;
|
||||
};
|
||||
|
||||
services.logind.lidSwitchExternalPower = "ignore";
|
||||
|
||||
|
|
13
hosts/nixedo/modules/default.nix
Normal file
13
hosts/nixedo/modules/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
imports = [
|
||||
./acme.nix
|
||||
./audiobookshelf.nix
|
||||
./cloudflared.nix
|
||||
./containers
|
||||
./forgejo.nix
|
||||
./immich.nix
|
||||
./jellyfin.nix
|
||||
./nginx
|
||||
./paperless.nix
|
||||
];
|
||||
}
|
|
@ -1,61 +1,35 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
git = {
|
||||
name = "Oliver Davies";
|
||||
emailAddress = "oliver@oliverdavies.uk";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = with inputs.self.nixosModules; [
|
||||
imports = [
|
||||
../common
|
||||
|
||||
./hardware-configuration.nix
|
||||
./modules
|
||||
./secrets.nix
|
||||
./services.nix
|
||||
|
||||
editor-nvim
|
||||
mixins-avahi
|
||||
mixins-bluetooth
|
||||
mixins-common
|
||||
mixins-direnv
|
||||
mixins-firefox
|
||||
mixins-flameshot
|
||||
mixins-fonts
|
||||
mixins-fzf
|
||||
mixins-gnupg
|
||||
mixins-gtk
|
||||
mixins-qutebrowser
|
||||
mixins-mpv
|
||||
mixins-node
|
||||
mixins-notes
|
||||
mixins-phpactor
|
||||
mixins-pipewire
|
||||
mixins-ranger
|
||||
mixins-screenkey
|
||||
mixins-scripts
|
||||
mixins-starship
|
||||
mixins-thunar
|
||||
mixins-tmux
|
||||
mixins-zram
|
||||
mixins-zsh
|
||||
profiles-dwm
|
||||
profiles-xbanish
|
||||
|
||||
(import ../../modules/mixins/git.nix { inherit git; })
|
||||
|
||||
(import ../../modules/mixins/kanata.nix {
|
||||
devices = [
|
||||
"/dev/input/event1"
|
||||
];
|
||||
})
|
||||
|
||||
users-opdavies
|
||||
|
||||
./modules/cron.nix
|
||||
./modules/neomutt.nix
|
||||
./modules/newsboat
|
||||
./modules/ollama.nix
|
||||
./modules/wiki.nix
|
||||
../../users/opdavies.nix
|
||||
];
|
||||
|
||||
nixosModules = {
|
||||
core = {
|
||||
bluetooth.enable = true;
|
||||
openssh.enable = true;
|
||||
pipewire.enable = true;
|
||||
xbanish.enable = true;
|
||||
zram.enable = true;
|
||||
};
|
||||
|
||||
desktop = {
|
||||
dconf.enable = true;
|
||||
dwm.enable = true;
|
||||
fonts.enable = true;
|
||||
st.enable = true;
|
||||
thunar.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
|
@ -118,35 +92,4 @@ in
|
|||
zeroad
|
||||
zoom-us
|
||||
];
|
||||
|
||||
services = {
|
||||
auto-cpufreq.enable = true;
|
||||
gvfs.enable = true;
|
||||
power-profiles-daemon.enable = false;
|
||||
printing.enable = true;
|
||||
pulseaudio.enable = false;
|
||||
throttled.enable = true;
|
||||
thermald.enable = true;
|
||||
upower.enable = true;
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
|
||||
displayManager.startx.enable = true;
|
||||
|
||||
xkb = {
|
||||
layout = "gb";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
home-manager.users.opdavies = {
|
||||
xdg.configFile."pam-gnupg".text = ''
|
||||
098EE055DAD2B9CB68154C6759DD38292D2273B6
|
||||
1E21B58D69FFEFAD077F152A50FEA938A3413F50
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
9
hosts/t480/modules/default.nix
Normal file
9
hosts/t480/modules/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./cron.nix
|
||||
./neomutt.nix
|
||||
./newsboat
|
||||
./ollama.nix
|
||||
./wiki.nix
|
||||
];
|
||||
}
|
23
hosts/t480/services.nix
Normal file
23
hosts/t480/services.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
services = {
|
||||
auto-cpufreq.enable = true;
|
||||
gvfs.enable = true;
|
||||
power-profiles-daemon.enable = false;
|
||||
printing.enable = true;
|
||||
pulseaudio.enable = false;
|
||||
throttled.enable = true;
|
||||
thermald.enable = true;
|
||||
upower.enable = true;
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
|
||||
displayManager.startx.enable = true;
|
||||
|
||||
xkb = {
|
||||
layout = "gb";
|
||||
variant = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,20 +1,27 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = with inputs.self.nixosModules; [
|
||||
imports = [
|
||||
../common
|
||||
|
||||
./hardware-configuration.nix
|
||||
./hardware.nix
|
||||
./programs.nix
|
||||
./secrets.nix
|
||||
./services
|
||||
./users.nix
|
||||
|
||||
mixins-common
|
||||
mixins-zram
|
||||
|
||||
users-opdavies
|
||||
../../users/opdavies.nix
|
||||
];
|
||||
|
||||
nixosModules = {
|
||||
core = {
|
||||
bluetooth.enable = true;
|
||||
zram.enable = true;
|
||||
};
|
||||
|
||||
desktop.dconf.enable = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
dconf.enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue