2
2
mirror of https://git.feal.no/felixalb/nixos-config.git synced 2024-12-21 19:57:30 +01:00

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-13 14:10:54 +02:00
parent 6cc3332d38
commit 5ea3e8730d
15 changed files with 117 additions and 254 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

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

View File

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

View File

@ -14,6 +14,8 @@
pwdLength = "long";
showReturnVal = true;
};
history.extended = true;
historySubstringSearch.enable = true;
terminal.autoTitle = true;
pmodules = [
@ -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,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;
wayland = true;
};
videoDrivers = [ "nvidia" ];
xkbOptions = "ctrl:nocaps";
layout = "no,us";
xkbVariant = "intl";
};
#hardware.nvidia.modesetting.enable = true; # TODO: Fix this. Steam crashes, and textures/fonts unload when suspended.
hardware.keyboard.zsa.enable = true;
environment.sessionVariables.NIXOS_OZONE_WL = "1";
environment.systemPackages = with pkgs; [
xclip
pavucontrol
];
hardware.opengl.enable = true;
@ -55,28 +54,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 +84,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

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

View File

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