diff --git a/flake.nix b/flake.nix index b9008b5..939e503 100644 --- a/flake.nix +++ b/flake.nix @@ -33,8 +33,7 @@ lift = nixpkgs.lib.nixosSystem { inherit system; modules = [ - ./hosts/lift/configuration.nix - ./hosts/lift/hardware-configuration.nix + ./hosts/lift ]; }; tien = nixpkgs.lib.nixosSystem { diff --git a/hosts/lift/configuration.nix b/hosts/lift/configuration.nix index c539af8..3bb1809 100644 --- a/hosts/lift/configuration.nix +++ b/hosts/lift/configuration.nix @@ -1,10 +1,6 @@ { pkgs, ... }: { - imports = [ - ../../modules/printing.nix - ]; - # Bootloader. boot.loader.grub.enable = true; boot.loader.grub.device = "/dev/sda"; @@ -20,49 +16,16 @@ boot.initrd.luks.devices."luks-efc0285c-812e-4946-936b-37e737fb72eb".keyFile = "/crypto_keyfile.bin"; - # allow crosscompiling for raspberrypi - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - networking.hostName = "lift"; - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. networking.networkmanager.enable = true; systemd.network.wait-online.enable = false; boot.initrd.systemd.network.wait-online.enable = false; - nix.settings.experimental-features = ["nix-command" "flakes"]; - - # 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"; - }; - - - # Configure console keymap - console.keyMap = "de-latin1-nodeadkeys"; - - # Enable scanning - hardware.sane.enable = true; - hardware.keyboard.zsa.enable = true; - hardware.graphics.enable = true; # bluetooth hardware.bluetooth.enable = true; - # hardware.pulseaudio.enable = false; security.rtkit.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. @@ -85,120 +48,28 @@ nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ - ack avrdude - bind - calibre - cmake cryptsetup - curl - dracula-theme - evince ffmpeg - fish fzf gammastep - gcc - gimp - git glib - eog - nautilus - simple-scan - gnucash - gnumake gnupg - google-cloud-sdk - inkscape ispell keychain - libreoffice hugo mosquitto mypy - nmap - pass-secret-service - pavucontrol - portfolio - prusa-slicer - pulseaudio - signal-desktop - spotify sqlite - syncthing - tailscale - tmux - tree - unzip - vim-full - vlc - wally-cli - wayshot - wdisplays - wget - wl-clipboard - xdg-utils - yt-dlp ]; - xdg.portal = { - enable = true; - wlr.enable = true; - # gtk portal needed to make gtk apps happy - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - config.common.default = "*"; - }; - - programs = { - fish.enable = true; - gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - light.enable = true; - }; - # List services that you want to enable: - services.resolved = { - enable = true; - }; services.pcscd.enable = true; - # xdg-desktop-portal works by exposing a series of D-Bus interfaces - # known as portals under a well-known name - # (org.freedesktop.portal.Desktop) and object path - # (/org/freedesktop/portal/desktop). - # The portal interfaces include APIs for file access, opening URIs, - # printing and others. - services.dbus.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - }; services.passSecretService.enable = true; - services.tailscale.enable = true; services.gvfs.enable = true; - services.greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --cmd sway"; - user = "rothe"; - }; - }; - }; - services.blueman.enable = true; services.fwupd.enable = true; - services.syncthing = { - enable = true; - user = "rothe"; - group = "users"; - dataDir = "/home/rothe"; - overrideFolders = false; - overrideDevices = false; - }; networking.nftables = { enable = true; @@ -216,18 +87,4 @@ incus.enable = false; podman.enable = true; }; - - programs.nh = { - enable = true; - clean.enable = true; - clean.extraArgs = "--keep-since 4d --keep 3"; - flake = "/home/rothe/src/nixos-config"; - }; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - localNetworkGameTransfers.openFirewall = true; - }; } diff --git a/hosts/lift/default.nix b/hosts/lift/default.nix new file mode 100644 index 0000000..c0d8ca3 --- /dev/null +++ b/hosts/lift/default.nix @@ -0,0 +1,11 @@ +{...}: +{ + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ../../modules/terminal/base.nix + ../../modules/graphical/base.nix + ../../modules/graphical/printing.nix + ../../modules/graphical/steam.nix + ]; +} diff --git a/modules/graphical/base.nix b/modules/graphical/base.nix new file mode 100644 index 0000000..ce3d2e7 --- /dev/null +++ b/modules/graphical/base.nix @@ -0,0 +1,79 @@ +{pkgs, ...}: +{ + hardware.sane.enable = true; + hardware.graphics.enable = true; + + environment.systemPackages = with pkgs; [ + calibre + dracula-theme + evince + gimp + eog + nautilus + simple-scan + inkscape + libreoffice + pavucontrol + portfolio + prusa-slicer + pulseaudio + signal-desktop + spotify + syncthing + vlc + wayshot + wdisplays + wl-clipboard + xdg-utils + yt-dlp + ]; + + programs = { + light.enable = true; + sway.enable = true; + }; + + services = { + dbus.enable = true; + greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --asterisks --cmd sway"; + user = "rothe"; + }; + }; + }; + pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + }; + syncthing = { + enable = true; + user = "rothe"; + group = "users"; + dataDir = "/home/rothe"; + overrideFolders = false; + overrideDevices = false; + }; + }; + + programs = { + # Helper for nixos output + nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + flake = "/home/rothe/src/nixos-config"; + }; + }; + + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + config.common.default = "*"; + }; +} diff --git a/modules/printing.nix b/modules/graphical/printing.nix similarity index 82% rename from modules/printing.nix rename to modules/graphical/printing.nix index 66f8664..6b26c67 100644 --- a/modules/printing.nix +++ b/modules/graphical/printing.nix @@ -10,7 +10,8 @@ }; services.printing.drivers = [ - (pkgs.writeTextDir "share/cups/model/kyocera_fs-1300d.ppd" (builtins.readFile ../files/kyocera_fs-1300d.ppd)) + (pkgs.writeTextDir "share/cups/model/kyocera_fs-1300d.ppd" + (builtins.readFile ../../files/kyocera_fs-1300d.ppd)) ]; hardware.printers = { ensurePrinters = [ diff --git a/modules/graphical/steam.nix b/modules/graphical/steam.nix new file mode 100644 index 0000000..a050e5d --- /dev/null +++ b/modules/graphical/steam.nix @@ -0,0 +1,9 @@ +{...}: +{ + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; +} diff --git a/modules/terminal/base.nix b/modules/terminal/base.nix new file mode 100644 index 0000000..d6c1d8d --- /dev/null +++ b/modules/terminal/base.nix @@ -0,0 +1,51 @@ +{pkgs, ...}: +{ + nix.settings.experimental-features = ["nix-command" "flakes"]; + + 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"; + }; + + console.keyMap = "de-latin1-nodeadkeys"; + + environment.systemPackages = with pkgs; [ + bind + cmake + curl + gcc + git + gnumake + nmap + tmux + tree + unzip + wget + ]; + + hardware.keyboard.zsa.enable = true; + + programs = { + fish.enable = true; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + services = { + resolved.enable = true; + tailscale.enable = true; + }; +}