Add felixalbpc. Remove edison. Clean home-manager base and flake. #3

Merged
felixalb merged 2 commits from add-felixalbpc into main 2024-09-13 14:12:10 +02:00
17 changed files with 226 additions and 293 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

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
imports = [ imports = [
./neovim.nix ./neovim.nix
@ -7,9 +7,12 @@
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
bat
bottom bottom
unstable.ncdu ncdu
neofetch neofetch
sshfs
sshuttle
]; ];
sessionVariables = { sessionVariables = {
@ -35,7 +38,7 @@
user = { user = {
name = "Felix Albrigtsen"; name = "Felix Albrigtsen";
email = "felix@albrigtsen.it"; email = lib.mkDefault "felix@albrigtsen.it";
}; };
}; };
ignores = [ ignores = [

View File

@ -21,7 +21,6 @@ in {
telescope-nvim telescope-nvim
nvim-lspconfig nvim-lspconfig
# copilot-vim
nvim-treesitter nvim-treesitter
coc-css coc-css
@ -32,6 +31,7 @@ in {
coc-pyright coc-pyright
vim-nix vim-nix
vim-puppet
]; ];
withNodeJs = true; withNodeJs = true;
@ -122,6 +122,11 @@ in {
" Disable search highlights " Disable search highlights
map <Leader><Space> :noh<CR> map <Leader><Space> :noh<CR>
" Start with copilot disabled
if exists("*Copilot")
autocmd VimEnter * Copilot disable
endif
''; '';
}; };

View File

@ -2,6 +2,7 @@
programs = { programs = {
zsh = { zsh = {
enable = true; enable = true;
history.extended = true;
prezto = { prezto = {
enable = true; enable = true;
@ -21,6 +22,7 @@
"terminal" "terminal"
"editor" "editor"
"history" "history"
"history-substring-search"
# "directory" # "directory"
"spectrum" "spectrum"
# "utility" # "utility"
@ -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,10 +0,0 @@
{ config, pkgs, lib, ... }:
{
services.xserver.desktopManager.gnome.enable = true;
environment.systemPackages = with pkgs; [
gnomeExtensions.appindicator
gnome.adwaita-icon-theme
];
services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
programs.dconf.enable = true;
}

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

@ -1,30 +0,0 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
nix-index
unstable.snicat
python3
] ++ (with python3Packages; [
beautifulsoup4
numpy
pillow
pwntools
pycryptodome
requests
]);
imports = [
./../../home/base.nix
./email.nix
];
programs = {
zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config";
alacritty.enable = true;
firefox.enable = true;
rofi.enable = true;
};
home.stateVersion = "23.05";
}

View File

@ -0,0 +1,40 @@
{ 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; }
];
};
tempAddresses = "disabled";
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";
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"copilot.vim"
];
users.users.felixalb = {
uid = 1328256;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [ ];
};
system.stateVersion = "24.05";
}

View File

@ -1,30 +1,38 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = [
./remote.nix
./gnome.nix
./xfce.nix
];
services.xserver = { services.xserver = {
enable = true; enable = true;
displayManager.gdm = { displayManager.gdm = {
enable = true; enable = true;
wayland = true; wayland = true;
}; };
videoDrivers = [ "nvidia" ]; xkb = {
xkbOptions = "ctrl:nocaps"; options = "ctrl:nocaps";
variant = "intl";
layout = "no,us"; layout = "no,us";
xkbVariant = "intl"; };
windowManager.qtile.enable = true;
}; };
#hardware.nvidia.modesetting.enable = true; # TODO: Fix this. Steam crashes, and textures/fonts unload when suspended. programs.hyprland.enable = true;
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; [ home-manager.users.felixalb = {
services = {
dunst.enable = true;
};
home.packages = with pkgs; [
i3lock
libnotify
pamixer
pavucontrol
sxhkd
xclip xclip
xss-lock
]; ];
};
hardware.opengl.enable = true; hardware.opengl.enable = true;
@ -55,28 +63,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 +93,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

@ -0,0 +1,35 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptlvm".device = "/dev/disk/by-uuid/7516ebdb-14c3-4cb5-9d06-5e9d0e34b798";
fileSystems."/" =
{ device = "/dev/disk/by-uuid/02ac773e-31ff-4579-ad9a-859ba74f2a9e";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/77ED-720D";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-label/swap"; }
];
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

56
hosts/felixalbpc/home.nix Normal file
View File

@ -0,0 +1,56 @@
{ pkgs, lib, ... }:
{
imports = [
./../../home/base.nix
./../../home/alacritty.nix
];
home.packages = with pkgs; [
catimg
chromium
dante
dig
element-desktop
jq
maim
mpv
oauth2ms
openssl
openstackclient
pwgen
remmina
w3m
(python311.withPackages (ps: with ps; [
numpy
pycryptodome
python-novaclient
requests
]))
];
programs = {
aerc.enable = true;
alacritty.enable = true;
firefox.enable = true;
git.extraConfig.user.email = "felix.albrigtsen@ntnu.no";
rofi.enable = true;
zsh.shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config";
neovim.plugins = with pkgs.vimPlugins; [ copilot-vim ];
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
};
};
home.stateVersion = "24.05";
}

View File

@ -18,14 +18,12 @@
spotify spotify
aerc aerc
bat
borgbackup borgbackup
catimg catimg
cocoapods cocoapods
gnutar gnutar
nix-index nix-index
nodejs nodejs
sshuttle
tldr tldr
unstable.snicat unstable.snicat
w3m w3m
@ -43,8 +41,11 @@
prezto.pmodules = [ "ssh" ]; prezto.pmodules = [ "ssh" ];
}; };
# Ctrl+y + , programs.neovim.plugins = with pkgs.vimPlugins; [
programs.neovim.plugins = with pkgs.vimPlugins; [ coc-emmet emmet-vim ]; coc-emmet
copilot-vim
emmet-vim # Ctrl+y + ,
];
# Copy Applications to ~/Applications to allow them to be launched from Spotlight # Copy Applications to ~/Applications to allow them to be launched from Spotlight
disabledModules = [ "targets/darwin/linkapps.nix" ]; disabledModules = [ "targets/darwin/linkapps.nix" ];