From 87db9887c2173a3a040794094394f7046883fd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Thu, 1 May 2025 23:48:42 +0200 Subject: [PATCH] System Gen181 @ 2025-05-01-23:48:40 by jonas@comfy-station --- flake.nix | 32 ++++++- home/jonas@monolith.nix | 80 +++++++++++++++++ hosts/comfy-station/configuration.nix | 7 +- hosts/monolith/configuration.nix | 123 ++++++++++++++++++++++++++ 4 files changed, 234 insertions(+), 8 deletions(-) create mode 100644 home/jonas@monolith.nix create mode 100644 hosts/monolith/configuration.nix diff --git a/flake.nix b/flake.nix index ae38098..1e21813 100644 --- a/flake.nix +++ b/flake.nix @@ -60,16 +60,29 @@ }; modules = [ ({...}: {nixpkgs.overlays = [overlay-unstable];}) + ({...}: {nixpkgs.config.allowUnfree = true;}) + nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 + inputs.sops-nix.nixosModules.sops + ./hosts/comfy-station/configuration.nix + ]; + }; + monolith = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + }; + modules = [ + ({...}: {nixpkgs.overlays = [overlay-unstable];}) + ({...}: {nixpkgs.config.allowUnfree = true;}) { nix.settings = { substituters = ["https://cosmic.cachix.org/"]; trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="]; }; } - nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1 inputs.sops-nix.nixosModules.sops nixos-cosmic.nixosModules.default - ./hosts/comfy-station/configuration.nix + ./hosts/monolith/configuration.nix ]; }; harbor = nixpkgs.lib.nixosSystem { @@ -125,6 +138,21 @@ # to pass through arguments to home.nix extraSpecialArgs = {inherit inputs;}; }; + homeConfigurations."jonas@monolith" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ + ({...}: {nixpkgs.overlays = [overlay-unstable];}) + ({...}: {nixpkgs.config.allowUnfree = true;}) + (./home + "/jonas@monolith.nix") + ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + extraSpecialArgs = {inherit inputs;}; + }; homeConfigurations."jroeger" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.${system}; diff --git a/home/jonas@monolith.nix b/home/jonas@monolith.nix new file mode 100644 index 0000000..3a67547 --- /dev/null +++ b/home/jonas@monolith.nix @@ -0,0 +1,80 @@ +{config, ...}: rec { + imports = [ + ../modules/home/borg.nix + ../modules/home/doom + ../modules/home/firefox.nix + ../modules/home/kdeconnect.nix + ../modules/home/kitty + ../modules/home/nextcloud + ../modules/home/ranger + ../modules/home/ssh.nix + ../modules/home/yubikey.nix + ../modules/home/zsh + ]; + + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "jonas"; + home.homeDirectory = "/home/jonas"; + + sops = { + age.keyFile = "${home.homeDirectory}/.config/sops/age/keys.txt"; + }; + + doom.enable = true; + doom.enableCopilot = true; + doom.withNixPkgs = true; + doom.withShellPkgs = true; + + # Make session variables available in systemd units + # SEE: https://github.com/nix-community/home-manager/pull/5543 + # systemd.user.settings.Manager.DefaultEnvironment = + # lib.mapAttrs (_: lib.mkDefault) config.home.sessionVariables; + + 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"; + }; + }; + xdg.userDirs.enable = true; + xdg.userDirs.createDirectories = true; + xdg.userDirs.extraConfig = { + XDG_WORKSPACES_DIR = "${config.home.homeDirectory}/Workspaces"; + XDG_NEXTCLOUD_DIR = "${config.home.homeDirectory}/Nextcloud"; + XDG_NOTES_DIR = "${config.home.homeDirectory}/Notes"; + }; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.11"; # Please read the comment before changing. + + home.sessionVariables = { + EDITOR = "vim"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + # Git + programs.git = { + enable = true; + userName = "Jonas Röger"; + userEmail = "jonas.roeger@tu-dortmund.de"; + difftastic.enable = true; + signing = { + signByDefault = true; + key = "4000EB35E1AE0F07"; + }; + }; +} diff --git a/hosts/comfy-station/configuration.nix b/hosts/comfy-station/configuration.nix index 6bac7bc..14f66b3 100644 --- a/hosts/comfy-station/configuration.nix +++ b/hosts/comfy-station/configuration.nix @@ -4,13 +4,11 @@ { config, pkgs, - inputs, ... }: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - inputs.home-manager.nixosModules.home-manager ../../modules/bin/nix-scripts.nix ../../modules/desktop/de ../../modules/desktop/dm @@ -63,9 +61,6 @@ programs.zsh.enable = true; - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; @@ -140,7 +135,7 @@ # ld-fix programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ + programs.nix-ld.libraries = [ # Add any missing dynamic libraries for unpackaged programs # here, NOT in environment.systemPackages ]; diff --git a/hosts/monolith/configuration.nix b/hosts/monolith/configuration.nix new file mode 100644 index 0000000..968f9c9 --- /dev/null +++ b/hosts/monolith/configuration.nix @@ -0,0 +1,123 @@ +# 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’). +{pkgs, ...}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../modules/bin/nix-scripts.nix + ../../modules/desktop/de + ../../modules/desktop/dm + ../../modules/desktop/fonts + ../../modules/hardware/bluetooth.nix + ../../modules/hardware/printing.nix + ../../modules/hardware/sound.nix + ../../modules/hardware/yubikey.nix + ../../modules/networking/wireguard + ../../modules/programs.nix + ../../modules/services/virt-manager.nix + ]; + + # Secret management + # sops.age.keyFile = "/var/lib/sops-nix/key.txt"; + + services.virt-manager.enable = true; + services.virt-manager.forUsers = ["jonas"]; + + nix = { + settings = { + experimental-features = ["nix-command" "flakes"]; + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.jonas = { + isNormalUser = true; + description = "Jonas"; + extraGroups = ["networkmanager" "wheel" "docker" "dialout"]; + }; + users.defaultUserShell = pkgs.zsh; + + programs.zsh.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? + + # boot + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.plymouth.enable = true; + boot.initrd.systemd.enable = true; + boot.supportedFilesystems = ["ntfs"]; + + # Configure console keymap + console.keyMap = "de"; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + 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"; + }; + + networking.hostName = "monolith"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # ld-fix + programs.nix-ld.enable = true; + programs.nix-ld.libraries = [ + # Add any missing dynamic libraries for unpackaged programs + # here, NOT in environment.systemPackages + ]; +}