diff --git a/dotfiles b/dotfiles index ea8b60f..f91ac0b 160000 --- a/dotfiles +++ b/dotfiles @@ -1 +1 @@ -Subproject commit ea8b60f8bc7398661990063b8b723ee2f5a6a924 +Subproject commit f91ac0b0ac7dd84ef20c8becc9b9690a3d882018 diff --git a/flake.lock b/flake.lock index b57e22b..04b3c6e 100644 --- a/flake.lock +++ b/flake.lock @@ -7,31 +7,32 @@ ] }, "locked": { - "lastModified": 1700695018, - "narHash": "sha256-MAiPLgBF4GLzSOlhnPCDWkWW5CDx4i7ApIYaR+TwTVg=", + "lastModified": 1710888565, + "narHash": "sha256-s9Hi4RHhc6yut4EcYD50sZWRDKsugBJHSbON8KFwoTw=", "owner": "nix-community", "repo": "home-manager", - "rev": "134deb46abd5d0889d913b8509413f6f38b0811e", + "rev": "f33900124c23c4eca5831b9b5eb32ea5894375ce", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-23.11", "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1700390070, - "narHash": "sha256-de9KYi8rSJpqvBfNwscWdalIJXPo8NjdIZcEJum1mH0=", + "lastModified": 1711460390, + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e4ad989506ec7d71f7302cc3067abd82730a4beb", + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index b08a895..db5f3f8 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,9 @@ description = "System config"; inputs = { - nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; + nixpkgs.url = github:nixos/nixpkgs/nixos-23.11; home-manager = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-23.11"; inputs.nixpkgs.follows = "nixpkgs"; }; }; @@ -27,7 +27,10 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.dm = { - imports = [ ./home.nix ]; + imports = [ + ./hosts/home-common.nix + ./hosts/home-workstations.nix + ]; }; } ]; @@ -41,7 +44,30 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.dm = { - imports = [ ./home.nix ]; + imports = [ + ./hosts/home-common.nix + ./hosts/home-workstations.nix + ]; + }; + } + ]; + }; + + dmeiburg = lib.nixosSystem { + system = "aarch64-linux"; + pkgs = import nixpkgs { + system = "aarch64-linux"; + config.allowUnfree = true; + }; + modules = [ + ./hosts/dmeiburg/configuration.nix + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.dm = { + imports = [ + ./hosts/home-common.nix + ]; }; } ]; diff --git a/hosts/common.nix b/hosts/common.nix new file mode 100644 index 0000000..708b710 --- /dev/null +++ b/hosts/common.nix @@ -0,0 +1,56 @@ +{ config, pkgs, ... }: + +{ + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + time.timeZone = "Europe/Berlin"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "de_DE.UTF-8"; + LC_IDENTIFICATION = "de_DE.UTF-8"; + LC_MEASUREMENT = "de_DE.UTF-8"; + LC_MONETARY = "de_DE.UTF-8"; + LC_NAME = "de_DE.UTF-8"; + LC_NUMERIC = "de_DE.UTF-8"; + LC_PAPER = "de_DE.UTF-8"; + LC_TELEPHONE = "de_DE.UTF-8"; + LC_TIME = "de_DE.UTF-8"; + }; + + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + + users.users.dm = { + isNormalUser = true; + description = "Daniel Meiburg"; + extraGroups = [ "networkmanager" "wheel" "dialout"]; + packages = with pkgs; [ + ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJipJtCrYUPokjppDdz97XHo2vEDBUzgvUU33Wst6AWt openpgp:0xF3D173A6" + ]; + }; + + networking.networkmanager.enable = true; + + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + programs.fish.enable = true; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; +} diff --git a/hosts/dmeiburg/configuration.nix b/hosts/dmeiburg/configuration.nix new file mode 100644 index 0000000..05c6644 --- /dev/null +++ b/hosts/dmeiburg/configuration.nix @@ -0,0 +1,34 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../common.nix + ]; + + networking.hostName = "dmeiburg"; # Define your hostname. + networking.firewall.trustedInterfaces = [ "docker0" ]; + networking.firewall.allowedTCPPorts = [ 22 80 443 ]; + + environment.systemPackages = with pkgs; [ + gnupg + pinentry + ]; + + virtualisation.docker.enable = true; + users.users.dm.extraGroups = [ "docker" ]; + + programs = { + gnupg.agent = { + enable = true; + }; + }; + + system.stateVersion = "23.11"; # Did you read the comment? + +} diff --git a/hosts/dmeiburg/hardware-configuration.nix b/hosts/dmeiburg/hardware-configuration.nix new file mode 100644 index 0000000..466030f --- /dev/null +++ b/hosts/dmeiburg/hardware-configuration.nix @@ -0,0 +1,36 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "virtio_scsi" "ahci" "usbhid" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a31d9dbe-42dd-44ba-acc0-39d33795dcce"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1FDC-BEDE"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/hosts/home-common.nix b/hosts/home-common.nix new file mode 100644 index 0000000..f72ddd7 --- /dev/null +++ b/hosts/home-common.nix @@ -0,0 +1,18 @@ +{ pkgs, ...}: + +{ + home.packages = with pkgs; [ + fd # find alternative + git + htop + neovim + nmap + nnn + pv + ripgrep + ]; + home.stateVersion = "22.11"; + programs.home-manager = { + enable = true; + }; +} diff --git a/home.nix b/hosts/home-workstations.nix similarity index 79% rename from home.nix rename to hosts/home-workstations.nix index 12f79c1..071bfa3 100644 --- a/home.nix +++ b/hosts/home-workstations.nix @@ -2,18 +2,17 @@ { home.packages = with pkgs; [ - gnome.nautilus - anki + anytype + calc + conda dig direnv - fd # find alternative ffmpeg firefox-wayland fuzzel fzf gcc - git - git-lfs + gnome.nautilus gnumake gnupg gthumb @@ -25,22 +24,17 @@ megatools mpv networkmanagerapplet - nmap - nnn - nodejs obsidian + openconnect + owncloud-client pass - polkit_gnome pavucontrol pinentry-qt + polkit_gnome pulseaudio - pv - rawtherapee - rpi-imager - ripgrep + pynitrokey + sshfs swaybg - swaylock - swayidle thunderbird tmux tree-sitter @@ -50,33 +44,28 @@ wl-clipboard xdg-utils zathura - zotero ]; - home.stateVersion = "22.11"; - programs.home-manager = { - enable = true; - }; home.file = { ".config/" = { - source = ./dotfiles/.config; + source = ../dotfiles/.config; recursive = true; }; }; home.file = { ".xkb/" = { - source = ./dotfiles/.xkb; + source = ../dotfiles/.xkb; recursive = true; }; }; home.file = { ".profile" = { - source = ./dotfiles/.profile; + source = ../dotfiles/.profile; recursive = true; }; }; home.file = { ".tmux.conf" = { - source = ./dotfiles/.tmux.conf; + source = ../dotfiles/.tmux.conf; recursive = true; }; }; diff --git a/hosts/p14s/configuration.nix b/hosts/p14s/configuration.nix index 9f856ed..3ff0b57 100644 --- a/hosts/p14s/configuration.nix +++ b/hosts/p14s/configuration.nix @@ -3,7 +3,8 @@ { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix + ./hardware-configuration.nix + ../common.nix ../workstation.nix ]; diff --git a/hosts/workstation.nix b/hosts/workstation.nix index e2442fd..fa291ca 100644 --- a/hosts/workstation.nix +++ b/hosts/workstation.nix @@ -3,11 +3,9 @@ { nixpkgs.config.permittedInsecurePackages = [ "zotero-6.0.27" + "electron-25.9.0" ]; - -# Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + nixpkgs.config.allowUnfree = true; boot.initrd.secrets = { "/crypto_keyfile.bin" = null; @@ -18,24 +16,6 @@ hardware.opengl.enable = true; - networking.networkmanager.enable = true; - - time.timeZone = "Europe/Berlin"; - - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - fonts.packages = with pkgs; [ noto-fonts font-awesome @@ -46,7 +26,7 @@ hardware.bluetooth.enable = true; services.blueman.enable = true; -# Enable sound with pipewire. + # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; @@ -59,56 +39,22 @@ security.pam.services.swaylock = {}; - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - }; - }; - - users.users.dm = { - isNormalUser = true; - description = "Daniel Meiburg"; - extraGroups = [ "networkmanager" "wheel" "dialout"]; - packages = with pkgs; [ - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJipJtCrYUPokjppDdz97XHo2vEDBUzgvUU33Wst6AWt openpgp:0xF3D173A6" - ]; - }; - -# enable nitrokeys + # enable nitrokeys services.udev.packages = [ pkgs.nitrokey-udev-rules ]; programs = { ssh.startAgent = false; gnupg.agent = { - pinentryFlavor = "qt"; enable = true; + pinentryFlavor = "qt"; enableSSHSupport = true; }; }; - nixpkgs.config.allowUnfree = true; - environment.systemPackages = with pkgs; [ ]; - programs.neovim = { - enable = true; - viAlias = true; - vimAlias = true; - defaultEditor = true; - }; - programs.fish.enable = true; services.getty.autologinUser = "dm"; programs.dconf.enable = true; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - services.syncthing = { enable = true; user = "dm";