Merge pull request 'Add felixalbpc. Remove edison. Clean home-manager base and flake.' (#3) from add-felixalbpc into main

Reviewed-on: https://git.feal.no/felixalb/nixos-config/pulls/3
This commit is contained in:
Felix Albrigtsen 2024-09-13 14:12:10 +02:00
commit 93306b9332
17 changed files with 226 additions and 293 deletions

View File

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

View File

@ -47,6 +47,27 @@
in
{
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 {
system = "x86_64-linux";
specialArgs = {
@ -66,6 +87,7 @@
}
];
};
# General application server
defiant = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
@ -86,7 +108,8 @@
}
];
};
edison = nixpkgs.lib.nixosSystem {
# Work desktop
felixalbpc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
@ -95,35 +118,16 @@
# Overlays-module makes "pkgs.unstable" available in configuration.nix
({ config, pkgs, ... }: { nixpkgs.overlays = [ pkgs-overlay ]; })
./hosts/edison/configuration.nix
./hosts/felixalbpc/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = 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 {
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;
}
];
};
# Web host
malcolm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
@ -143,7 +147,7 @@
];
};
};
# Daily driver macbook
darwinConfigurations.worf = nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {

View File

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

View File

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

View File

@ -2,6 +2,7 @@
programs = {
zsh = {
enable = true;
history.extended = true;
prezto = {
enable = true;
@ -21,6 +22,7 @@
"terminal"
"editor"
"history"
"history-substring-search"
# "directory"
"spectrum"
# "utility"
@ -28,7 +30,6 @@
"git"
"autosuggestions"
"syntax-highlighting"
"history-substring-search"
"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, ... }:
{
imports = [
./remote.nix
./gnome.nix
./xfce.nix
];
services.xserver = {
enable = true;
displayManager.gdm = {
enable = true;
wayland = true;
};
videoDrivers = [ "nvidia" ];
xkbOptions = "ctrl:nocaps";
xkb = {
options = "ctrl:nocaps";
variant = "intl";
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;
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
xss-lock
];
};
hardware.opengl.enable = true;
@ -55,28 +63,28 @@
];
};
# Dark mode
home-manager.users.felixalb = {
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
# # Dark mode
# home-manager.users.felixalb = {
# dconf.settings = {
# "org/gnome/desktop/interface" = {
# color-scheme = "prefer-dark";
# };
# };
gtk = {
enable = true;
theme = {
name = "Adwaita-dark";
package = pkgs.gnome.gnome-themes-extra;
};
};
};
# gtk = {
# enable = true;
# theme = {
# name = "Adwaita-dark";
# package = pkgs.gnome.gnome-themes-extra;
# };
# };
# };
qt = {
enable = true;
platformTheme = "gnome";
style = "adwaita-dark";
};
# qt = {
# enable = true;
# platformTheme = "gnome";
# style = "adwaita-dark";
# };
# Misc:
xdg.portal = {
@ -85,7 +93,5 @@
};
location.provider = "geoclue2";
security.polkit.enable = true;
services.flatpak.enable = true;
services.redshift.enable = true;
users.users."felixalb".packages = [ pkgs.flatpak ];
services.openssh.settings.X11Forwarding = true;
}

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