Multiple changes (cleanup, remove edison, add felixalbpc)

- Removes hold host edison
- Adds new host, felixalbpc, a work machine. This requires some cleanup
  to fit into the office network, use other SSH keys, etc.
- Clean up some package installs, putting more things into the common
  home-manager packages, rather than systemwide or host-specific homes.
- Various small changes like disabling Github Copilot on nvim startup.
This commit is contained in:
Felix Albrigtsen 2024-09-11 10:33:15 +02:00
parent 276a4b8cec
commit a072fb0a2a
15 changed files with 117 additions and 254 deletions

View File

@ -5,8 +5,8 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking = { networking = {
domain = "home.feal.no"; domain = lib.mkDefault "home.feal.no";
nameservers = [ "192.168.10.175" "192.168.10.1" "1.1.1.1" ]; nameservers = lib.mkDefault [ "192.168.10.175" "192.168.10.1" "1.1.1.1" ];
useDHCP = lib.mkDefault false; useDHCP = lib.mkDefault false;
}; };
@ -40,7 +40,6 @@
programs.zsh.enable = true; programs.zsh.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bat
bottom bottom
duf duf
eza eza
@ -51,14 +50,12 @@
htop htop
iotop iotop
lm_sensors lm_sensors
neofetch
nix-output-monitor nix-output-monitor
p7zip p7zip
python3 python3
ripgrep ripgrep
rsync rsync
screen screen
sshfs
unzip unzip
usbutils usbutils
vim vim
@ -85,12 +82,12 @@
users.users.felixalb = { users.users.felixalb = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ extraGroups = lib.mkDefault [
"wheel" "wheel"
"docker" "docker"
]; ];
uid = 1000; uid = lib.mkDefault 1000;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = lib.mkDefault [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDKzPICGew7uN0cmvRmbwkwTCodTBUgEhkoftQnZuO4Q felixalbrigtsen@gmail.com" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDKzPICGew7uN0cmvRmbwkwTCodTBUgEhkoftQnZuO4Q felixalbrigtsen@gmail.com"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTXSL0w7OUcz1LzEt1T3I3K5RgyNV+MYz0x/1RbpDHQ felixalb@worf" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTXSL0w7OUcz1LzEt1T3I3K5RgyNV+MYz0x/1RbpDHQ felixalb@worf"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFiPHhj0YbklJnJNcxD0IlzPxLTGfv095H5zyS/1Wb64 felixalb@edison.home.feal.no" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFiPHhj0YbklJnJNcxD0IlzPxLTGfv095H5zyS/1Wb64 felixalb@edison.home.feal.no"

View File

@ -47,6 +47,27 @@
in in
{ {
nixosConfigurations = { nixosConfigurations = {
# Networking / VPN Gateway
burnham = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
# Overlays-module makes "pkgs.unstable" available in configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; })
./hosts/burnham/configuration.nix
./common/domeneshop-dyndns.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."felixalb" = import ./hosts/burnham/home.nix;
}
];
};
# Media / storage server
challenger = nixpkgs.lib.nixosSystem { challenger = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
@ -66,6 +87,7 @@
} }
]; ];
}; };
# General application server
defiant = nixpkgs.lib.nixosSystem { defiant = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
@ -86,7 +108,8 @@
} }
]; ];
}; };
edison = nixpkgs.lib.nixosSystem { # Work desktop
felixalbpc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;
@ -95,35 +118,16 @@
# Overlays-module makes "pkgs.unstable" available in configuration.nix # Overlays-module makes "pkgs.unstable" available in configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; }) ({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; })
./hosts/edison/configuration.nix ./hosts/felixalbpc/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users."felixalb" = import ./hosts/edison/home.nix; home-manager.users."felixalb" = import ./hosts/felixalbpc/home.nix;
} }
]; ];
}; };
burnham = nixpkgs.lib.nixosSystem { # Web host
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
# Overlays-module makes "pkgs.unstable" available in configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; })
./hosts/burnham/configuration.nix
./common/domeneshop-dyndns.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."felixalb" = import ./hosts/burnham/home.nix;
}
];
};
malcolm = nixpkgs.lib.nixosSystem { malcolm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
@ -143,7 +147,7 @@
]; ];
}; };
}; };
# Daily driver macbook
darwinConfigurations.worf = nix-darwin.lib.darwinSystem { darwinConfigurations.worf = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin"; system = "aarch64-darwin";
specialArgs = { specialArgs = {

View File

@ -7,9 +7,13 @@
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
bat
bottom bottom
unstable.ncdu ncdu
neofetch neofetch
nodejs
sshfs
sshuttle
]; ];
sessionVariables = { sessionVariables = {
@ -35,7 +39,7 @@
user = { user = {
name = "Felix Albrigtsen"; name = "Felix Albrigtsen";
email = "felix@albrigtsen.it"; email = lib.mkDefault "felix@albrigtsen.it";
}; };
}; };
ignores = [ ignores = [

View File

@ -32,6 +32,7 @@ in {
coc-pyright coc-pyright
vim-nix vim-nix
vim-puppet
]; ];
withNodeJs = true; withNodeJs = true;
@ -122,6 +123,9 @@ in {
" Disable search highlights " Disable search highlights
map <Leader><Space> :noh<CR> map <Leader><Space> :noh<CR>
" Start with copilot disabled
autocmd VimEnter * Copilot disable
''; '';
}; };

View File

@ -14,6 +14,8 @@
pwdLength = "long"; pwdLength = "long";
showReturnVal = true; showReturnVal = true;
}; };
history.extended = true;
historySubstringSearch.enable = true;
terminal.autoTitle = true; terminal.autoTitle = true;
pmodules = [ pmodules = [
@ -28,7 +30,6 @@
"git" "git"
"autosuggestions" "autosuggestions"
"syntax-highlighting" "syntax-highlighting"
"history-substring-search"
"prompt" "prompt"
]; ];
}; };

View File

@ -1,55 +0,0 @@
{ config, pkgs, lib, ... }:
{
imports =
[
../../base.nix
../../common/metrics-exporters.nix
./hardware-configuration.nix
./desktop
];
virtualisation.docker.enable = true;
systemd.coredump.enable = true;
networking = {
hostName = "edison";
defaultGateway = "192.168.10.1";
interfaces.enp4s0.useDHCP = false;
interfaces.enp4s0.ipv4.addresses = [
{ address = "192.168.10.170"; prefixLength = 24; }
];
hostId = "8e84b281";
};
console.keyMap = "us";
# sops.defaultSopsFile = ../../secrets/edison/edison.yaml;
environment.variables = { EDITOR = "vim"; };
environment.systemPackages = with pkgs; [
discord
gimp
gparted
openvpn
pavucontrol
unstable.element-desktop
unstable.hydrus
];
programs.steam.enable = true;
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"discord"
"nvidia-x11"
"nvidia-settings"
"steam"
"steam-original"
"steam-run"
];
system.stateVersion = "23.05";
}

View File

@ -1,12 +0,0 @@
{ config, pkgs, lib, ... }:
{
# Microsoft-style Remote Desktop:
services.xrdp = {
enable = true;
defaultWindowManager = "xfce4-session"; # Avoid fancy animations, no hyprland/GNOME!
openFirewall = true;
};
# X window forwarding with `ssh -Y`
services.openssh.settings.X11Forwarding = true;
}

View File

@ -1,10 +0,0 @@
{ config, pkgs, lib, ... }:
{
services.xserver = {
desktopManager.xfce.enable = true;
};
environment.systemPackages = with pkgs; [
xfce.xfce4-pulseaudio-plugin
];
}

View File

@ -1,52 +0,0 @@
{ config, pkgs, lib, ... }:
{
programs.neomutt = {
enable = true;
sidebar = {
enable = true;
width = 30;
};
sort = "reverse-threads";
vimKeys = true;
checkStatsInterval = 60;
};
programs.mbsync.enable = true;
programs.notmuch = {
enable = true;
hooks = {
preNew = "mbsync --all";
};
};
# programs.msmtp.enable = true;
accounts.email = {
accounts.felix-albrigtsen-it = rec {
address = "felix@albrigtsen.it";
userName = address;
primary = true;
realName = "Felix Albrigtsen";
signature = {
text = ''
Med vennlig hilsen
${realName}
'';
showSignature = "append";
};
imap.host = "imap.migadu.com";
smtp.host = "smtp.migadu.com";
passwordCommand = "cat ~/.secrets/email/migadu"; # yolo / TODO
mbsync = {
enable = true;
create = "maildir"; # Create subfolders locally
# expugne = "both";
};
msmtp.enable = true;
notmuch.enable = true;
neomutt.enable = true;
};
};
}

View File

@ -1,46 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/14b254e1-d94f-4b9b-a910-7fcf7e33af46";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/A197-7913";
fsType = "vfat";
};
fileSystems."/data" =
{ device = "/dev/disk/by-uuid/ebbdf34e-adec-4df3-bbed-20d80455f3f7";
fsType = "ext4";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d56040a0-3009-4899-95fa-1b82e60e32e4"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault false;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -0,0 +1,35 @@
{ config, pkgs, lib, ... }:
{
imports =
[
../../base.nix
# ./hardware-configuration.nix
./desktop
];
networking = {
interfaces.eno1 = {
useDHCP = true;
ipv6.addresses = [
{ address = "2001:700:300:22::15"; prefixLength = 64; }
];
};
hostName = "felixalbpc";
nameservers = [ "129.241.0.200" "129.241.0.201" "2001:700:300::200" "2001:700:300::201" ];
domain = "it.ntnu.no";
hostId = "f458d6aa";
};
console.keyMap = "no";
users.users.felixalb = {
uid = 1328256;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [ ];
};
system.stateVersion = "24.05";
}

View File

@ -12,18 +12,17 @@
enable = true; enable = true;
wayland = true; wayland = true;
}; };
videoDrivers = [ "nvidia" ];
xkbOptions = "ctrl:nocaps"; xkbOptions = "ctrl:nocaps";
layout = "no,us"; layout = "no,us";
xkbVariant = "intl"; xkbVariant = "intl";
}; };
#hardware.nvidia.modesetting.enable = true; # TODO: Fix this. Steam crashes, and textures/fonts unload when suspended.
hardware.keyboard.zsa.enable = true; hardware.keyboard.zsa.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
xclip xclip
pavucontrol
]; ];
hardware.opengl.enable = true; hardware.opengl.enable = true;
@ -55,28 +54,28 @@
]; ];
}; };
# Dark mode # # Dark mode
home-manager.users.felixalb = { # home-manager.users.felixalb = {
dconf.settings = { # dconf.settings = {
"org/gnome/desktop/interface" = { # "org/gnome/desktop/interface" = {
color-scheme = "prefer-dark"; # color-scheme = "prefer-dark";
}; # };
}; # };
gtk = { # gtk = {
enable = true; # enable = true;
theme = { # theme = {
name = "Adwaita-dark"; # name = "Adwaita-dark";
package = pkgs.gnome.gnome-themes-extra; # package = pkgs.gnome.gnome-themes-extra;
}; # };
}; # };
}; # };
qt = { # qt = {
enable = true; # enable = true;
platformTheme = "gnome"; # platformTheme = "gnome";
style = "adwaita-dark"; # style = "adwaita-dark";
}; # };
# Misc: # Misc:
xdg.portal = { xdg.portal = {
@ -85,7 +84,5 @@
}; };
location.provider = "geoclue2"; location.provider = "geoclue2";
security.polkit.enable = true; security.polkit.enable = true;
services.flatpak.enable = true; services.openssh.settings.X11Forwarding = true;
services.redshift.enable = true;
users.users."felixalb".packages = [ pkgs.flatpak ];
} }

View File

@ -1,30 +1,29 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
imports = [
./../../home/base.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [
nix-index aerc
unstable.snicat element-desktop
openstackclient
remmina
python3 python3
] ++ (with python3Packages; [ ] ++ (with python3Packages; [
beautifulsoup4
numpy numpy
pillow
pwntools
pycryptodome pycryptodome
requests requests
]); ]);
imports = [
./../../home/base.nix
./email.nix
];
programs = { programs = {
zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config"; zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config";
git.extraConfig.user.email = "felix.albrigtsen@ntnu.no";
alacritty.enable = true; alacritty.enable = true;
firefox.enable = true; firefox.enable = true;
rofi.enable = true; rofi.enable = true;
}; };
home.stateVersion = "23.05"; home.stateVersion = "24.05";
} }

View File

@ -18,14 +18,11 @@
spotify spotify
aerc aerc
bat
borgbackup borgbackup
catimg catimg
cocoapods cocoapods
gnutar gnutar
nix-index nix-index
nodejs
sshuttle
tldr tldr
unstable.snicat unstable.snicat
w3m w3m