Extract lots of host config to common config

This commit is contained in:
Oystein Kristoffer Tveit 2022-06-12 00:07:40 +02:00
parent b3b9b5136d
commit 8e3f28bc31
4 changed files with 148 additions and 269 deletions

View File

@ -15,12 +15,41 @@ in {
keyMap = "us";
};
networking = {
useDHCP = false;
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
};
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
builders-use-substitutes = true
builders-use-substitutes = true
'';
distributedBuilds = config.networking.hostname != "Tsuki";
binaryCaches = [
"https://cache.nixos.org/"
];
buildMachines = [
{
hostName = "Tsuki";
system = "x86_64-linux";
maxJobs = 1;
speedFactor = 3;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-paralell"
"kvm"
];
mandatoryFeatures = [];
}
];
};
environment = {
@ -29,6 +58,12 @@ in {
VISUAL = "nvim";
};
systemPackages = with pkgs; [
wget
] + lib.optionals (!machineVars.headless) [
haskellPackages.xmobar
];
shells = with pkgs; [
bashInteractive
zsh
@ -104,6 +139,16 @@ in {
users.users.h7x4 = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wheel"
"networkmanager"
"docker"
"audio"
"video"
"disk"
"libvirtd"
"input"
];
};
home-manager = {
@ -117,10 +162,106 @@ in {
};
};
services = {
tumbler.enable = !machineVars.headless;
gnome.gnome-keyring.enable = !machineVars.headless;
openssh = {
# enable = true;
passwordAuthentication = false;
kbdInteractiveAuthentication = false;
permitRootLogin = "no";
};
dbus = {
enable = !machineVars.headless;
packages = with pkgs; [
gcr
dconf
];
};
xserver = {
enable = !machineVars.headless;
layout = "us";
xkbOptions = "caps:escape";
libinput = {
enable = true;
touchpad.disableWhileTyping = true;
};
desktopManager = {
xterm.enable = false;
xfce.enable = true;
};
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
# displayManager.startx.enable = true;
# displayManager.gdm.enable = true;
displayManager.lightdm.enable = true;
displayManager.defaultSession = "none+xmonad";
};
};
programs = {
dconf.enable = !machineVars.headless;
git.enable = true;
light.enable = !machineVars.headless;
npm.enable = true;
tmux.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
direnv-vim
vim-nix
vim-polyglot
];
opt = [
vim-monokai
];
};
customRC = ''
set number relativenumber
set undofile
set undodir=~/.cache/vim/undodir
packadd! vim-monokai
colorscheme monokai
'';
};
};
};
sound = {
enable = !machineVars.headless;
mediaKeys.enable = true;
};
hardware.pulseaudio.enable = !machineVars.headless;
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = /etc/${config.environment.etc.sudoLecture.target}
'';
system.stateVersion = "21.11";
system.stateVersion = "22.05";
}

View File

@ -28,7 +28,6 @@ in {
networking = {
hostName = "Eisei";
networkmanager.enable = true;
useDHCP = false;
interfaces = {
eno1.useDHCP = true;
@ -59,128 +58,20 @@ in {
services = {
openssh.enable = true;
gnome.gnome-keyring.enable = true;
printing.enable = true;
dbus = {
enable = true;
packages = with pkgs; [
gcr
gnome3.dconf
];
};
cron = {
enable = true;
systemCronJobs = [
# "*/5 * * * * root date >> /tmp/cron.log"
];
};
xserver = {
enable = true;
layout = "us";
xkbOptions = "caps:escape";
libinput = {
enable = true;
touchpad.disableWhileTyping = true;
};
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
};
};
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.bluetooth.enable = true;
nix = {
distributedBuilds = true;
binaryCaches = [
"https://cache.nixos.org/"
];
buildMachines = [
{
hostName = "Tsuki";
system = "x86_64-linux";
maxJobs = 1;
speedFactor = 3;
supportedFeatures = [
"nixos-test"
"benchmark"
"big-paralell"
"kvm"
];
mandatoryFeatures = [];
}
];
};
users.users.h7x4.extraGroups = [
"wheel"
"networkmanager"
"docker"
"disk"
"audio"
"video"
"libvirtd"
"input"
];
environment.systemPackages = with pkgs; [
wget
haskellPackages.xmobar
];
programs = {
dconf.enable = true;
git.enable = true;
light.enable = true;
npm.enable = true;
tmux.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
direnv-vim
vim-nix
vim-polyglot
];
opt = [
vim-monokai
];
};
customRC = ''
set number relativenumber
set undofile
set undodir=~/.cache/vim/undodir
packadd! vim-monokai
colorscheme monokai
'';
};
};
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
};
virtualisation = {
docker.enable = true;
libvirtd.enable = true;
# libvirtd.enable = true;
};
}

View File

@ -29,14 +29,9 @@
networking = {
hostName = "kasei";
networkmanager.enable = true;
useDHCP = false;
interfaces.wlp5s0.useDHCP = true;
interfaces.wlp2s0f0u4.useDHCP = true;
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
firewall.enable=true;
firewall.enable = true;
};
i18n = {
@ -54,44 +49,10 @@
# };
};
users.users.h7x4.extraGroups = [
"wheel"
"networkmanager"
"docker"
"audio"
"video"
"disk"
"libvirtd"
"input"
];
environment = {
shellAliases = {
fixscreen = "xrandr --output DP-4 --mode 1920x1080 --pos 0x0 -r 144 --output DVI-D-1 --primary --mode 1920x1080 --pos 1920x0 -r 60";
};
systemPackages = with pkgs; [
wget
haskellPackages.xmobar
];
};
services = {
openssh = {
enable = true;
passwordAuthentication = false;
challengeResponseAuthentication = false;
permitRootLogin = "no";
};
gnome.gnome-keyring.enable = true;
openssh.enable = true;
printing.enable = true;
dbus = {
enable = true;
packages = with pkgs; [
gcr
gnome3.dconf
];
};
cron = {
enable = true;
systemCronJobs = [
@ -99,66 +60,8 @@
];
};
xserver = {
enable = true;
layout = "us";
xkbOptions = "caps:escape";
displayManager.lightdm.enable = true;
libinput = {
enable = true;
touchpad.disableWhileTyping = true;
};
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
};
};
};
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.bluetooth.enable = true;
programs = {
dconf.enable = true;
git.enable = true;
light.enable = true;
npm.enable = true;
tmux.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
direnv-vim
vim-nix
vim-polyglot
];
opt = [
vim-monokai
];
};
customRC = ''
set number relativenumber
set undofile
set undodir=~/.cache/vim/undodir
packadd! vim-monokai
colorscheme monokai
'';
};
};
};
virtualisation = {
docker.enable = true;
libvirtd.enable = true;

View File

@ -49,22 +49,12 @@
networking = {
hostName = "Tsuki";
networkmanager.enable = true;
useDHCP = false;
interfaces.ens18.useDHCP = true;
nameservers = [
"1.1.1.1"
"8.8.8.8"
];
firewall.enable=true;
};
services = {
openssh = {
enable = true;
passwordAuthentication = false;
challengeResponseAuthentication = false;
permitRootLogin = "no";
};
openssh.enable = true;
printing.enable = true;
cron = {
enable = true;
@ -77,58 +67,12 @@
users.groups.media = {};
users.users = {
h7x4.extraGroups = [
"wheel"
"networkmanager"
"docker"
"disk"
"libvirtd"
"input"
];
media = {
isSystemUser = true;
group = "media";
};
};
environment.systemPackages = with pkgs; [
wget
];
programs = {
git.enable = true;
npm.enable = true;
tmux.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
configure = {
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
direnv-vim
vim-nix
vim-polyglot
];
opt = [
vim-monokai
];
};
customRC = ''
set number relativenumber
set undofile
set undodir=~/.cache/vim/undodir
packadd! vim-monokai
colorscheme monokai
'';
};
};
};
virtualisation = {
docker.enable = true;
libvirtd.enable = true;