diff options
author | sils <sils@sils.li> | 2023-01-08 19:30:04 +0100 |
---|---|---|
committer | sils <sils@sils.li> | 2023-01-08 19:30:04 +0100 |
commit | e70b7da28c7590a594ab209e959a5bc135e61811 (patch) | |
tree | 26eb976e5b08f0e27c0efb785c3647e49d177d82 | |
parent | switch away from temp-root (diff) | |
download | nix-config-e70b7da28c7590a594ab209e959a5bc135e61811.tar.gz nix-config-e70b7da28c7590a594ab209e959a5bc135e61811.zip |
introduce alejandra
-rw-r--r-- | configuration.nix | 108 | ||||
-rw-r--r-- | desktop/gnome.nix | 7 | ||||
-rw-r--r-- | desktop/plasma.nix | 16 | ||||
-rw-r--r-- | desktop/xfce.nix | 20 | ||||
-rw-r--r-- | env.nix | 40 | ||||
-rw-r--r-- | flatpak.nix | 16 | ||||
-rw-r--r-- | hardware/basesystem.nix | 132 | ||||
-rw-r--r-- | nix.nix | 22 | ||||
-rw-r--r-- | packages.nix | 113 | ||||
-rw-r--r-- | users.nix | 47 | ||||
-rw-r--r-- | zsh.nix | 84 |
11 files changed, 314 insertions, 291 deletions
diff --git a/configuration.nix b/configuration.nix index df0dd20..819cec8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,64 +1,66 @@ -{ config, pkgs, ... }: - let - compiledLayout = pkgs.runCommand "keyboard-layout" {} '' - ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./files/neoqwertz.xkb} $out - ''; - in { - imports = [ - ./hardware/basesystem.nix - ./env.nix - ./nix.nix - ./packages.nix - ./users.nix - ./zsh.nix - ./flatpak.nix # Mainly for minecraft + config, + pkgs, + ... +}: let + compiledLayout = pkgs.runCommand "keyboard-layout" {} '' + ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./files/neoqwertz.xkb} $out + ''; +in { + imports = [ + ./hardware/basesystem.nix + ./env.nix + ./nix.nix + ./packages.nix + ./users.nix + ./zsh.nix + ./flatpak.nix # Mainly for minecraft - # Desktop Environment to use - ./desktop/plasma.nix - ]; - - services = { - printing.enable = true; - xserver = { - layout = "de"; - #xkbVariant = ",neo"; - xkbOptions = "grp:win_space_toggle"; - displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY"; - }; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - }; + # Desktop Environment to use + ./desktop/plasma.nix + ]; - hardware = { - bluetooth.enable = true; - pulseaudio.enable = false; - }; - security.rtkit.enable = true; + services = { + printing.enable = true; + xserver = { + layout = "de"; + #xkbVariant = ",neo"; + xkbOptions = "grp:win_space_toggle"; + displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY"; + }; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + }; - environment.systemPackages = [ pkgs.xorg.xkbcomp ]; + hardware = { + bluetooth.enable = true; + pulseaudio.enable = false; + }; + security.rtkit.enable = true; - i18n.defaultLocale = "en_US.UTF-8"; + environment.systemPackages = [pkgs.xorg.xkbcomp]; - networking = { - hostName = "thinklappi"; - networkmanager.enable = true; - }; + i18n.defaultLocale = "en_US.UTF-8"; - time.timeZone = "Europe/Berlin"; + networking = { + hostName = "thinklappi"; + networkmanager.enable = true; + }; - console = { - font = "Lat2-Terminus16"; - keyMap = "de"; - #useXkbConfig = true; # use xkbOptions in tty. - }; + time.timeZone = "Europe/Berlin"; - programs.ssh.startAgent = true; + console = { + font = "Lat2-Terminus16"; + keyMap = "de"; + #useXkbConfig = true; # use xkbOptions in tty. + }; - system.stateVersion = "23.05"; + programs.ssh.startAgent = true; + + system.stateVersion = "23.05"; } diff --git a/desktop/gnome.nix b/desktop/gnome.nix index 505be78..630b30a 100644 --- a/desktop/gnome.nix +++ b/desktop/gnome.nix @@ -1,9 +1,10 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; - } diff --git a/desktop/plasma.nix b/desktop/plasma.nix index 412e3d3..75e5be1 100644 --- a/desktop/plasma.nix +++ b/desktop/plasma.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - { - services.xserver = { - enable = true; - displayManager.sddm.enable = true; - desktopManager.plasma5.enable = true; - }; + config, + pkgs, + ... +}: { + services.xserver = { + enable = true; + displayManager.sddm.enable = true; + desktopManager.plasma5.enable = true; + }; } diff --git a/desktop/xfce.nix b/desktop/xfce.nix index db2b65c..227e063 100644 --- a/desktop/xfce.nix +++ b/desktop/xfce.nix @@ -1,11 +1,13 @@ -{ config, pkgs, ... }: - { - services = { - blueman.enable = true; - xserver = { - enable = true; - desktopManager.xfce.enable = true; - }; - }; + config, + pkgs, + ... +}: { + services = { + blueman.enable = true; + xserver = { + enable = true; + desktopManager.xfce.enable = true; + }; + }; } diff --git a/env.nix b/env.nix index 11a1b0d..b0ebd72 100644 --- a/env.nix +++ b/env.nix @@ -1,27 +1,29 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { environment.sessionVariables = rec { - XDG_CACHE_HOME = "\${HOME}/.cache"; - XDG_CONFIG_HOME = "\${HOME}/.config"; - XDG_BIN_HOME = "\${HOME}/.local/bin"; - XDG_DATA_HOME = "\${HOME}/.local/share"; - XDG_STATE_HOME = "\${HOME}/.local/state"; - ZDOTDIR = "\${HOME}/.config/zsh"; - CARGO_HOME = "\${HOME}/.local/share/cargo"; - ANDROID_HOME = "\${HOME}/.local/share/android"; - ANSIBLE_HOME = "\${HOME}/.local/share/ansible"; + XDG_CACHE_HOME = "\${HOME}/.cache"; + XDG_CONFIG_HOME = "\${HOME}/.config"; + XDG_BIN_HOME = "\${HOME}/.local/bin"; + XDG_DATA_HOME = "\${HOME}/.local/share"; + XDG_STATE_HOME = "\${HOME}/.local/state"; + ZDOTDIR = "\${HOME}/.config/zsh"; + CARGO_HOME = "\${HOME}/.local/share/cargo"; + ANDROID_HOME = "\${HOME}/.local/share/android"; + ANSIBLE_HOME = "\${HOME}/.local/share/ansible"; #_JAVA_OPTIONS = '-Djava.util.prefs.userRoot="\${XDG_CONFIG_HOME}/java"'; - WINEPREFIX = "\${HOME}/.local/share/wine"; - GNUPGHOME = "\${HOME}/.local/share/gnupg"; - GRADLE_USER_HOME = "\${HOME}/.local/share/gradle"; - GTK2_RC_FILES = "\${HOME}/.config/gtk-2.0/gtkrc"; - EDITOR = "nvim"; - GOPATH = "\${HOME}/.local/share/go"; - XCOMPOSECACHE = "\${HOME}/.cache/X11/xcompose"; + WINEPREFIX = "\${HOME}/.local/share/wine"; + GNUPGHOME = "\${HOME}/.local/share/gnupg"; + GRADLE_USER_HOME = "\${HOME}/.local/share/gradle"; + GTK2_RC_FILES = "\${HOME}/.config/gtk-2.0/gtkrc"; + EDITOR = "nvim"; + GOPATH = "\${HOME}/.local/share/go"; + XCOMPOSECACHE = "\${HOME}/.cache/X11/xcompose"; #PYTHONSTARTUP="/etc/python/pythonrc"; - PATH = [ + PATH = [ "\${XDG_BIN_HOME}" ]; }; diff --git a/flatpak.nix b/flatpak.nix index 73352a6..fcc208d 100644 --- a/flatpak.nix +++ b/flatpak.nix @@ -1,9 +1,11 @@ -{ config, pkgs, ... }: - { - services.flatpak.enable = true; - fileSystems."/var/lib/flatpak" = { - device = "/srv/flatpak"; - options = [ "bind" ]; - }; + config, + pkgs, + ... +}: { + services.flatpak.enable = true; + fileSystems."/var/lib/flatpak" = { + device = "/srv/flatpak"; + options = ["bind"]; + }; } diff --git a/hardware/basesystem.nix b/hardware/basesystem.nix index ea1d303..021b9fd 100644 --- a/hardware/basesystem.nix +++ b/hardware/basesystem.nix @@ -1,71 +1,75 @@ -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot = { - initrd = { - availableKernelModules = [ "xhci_pci" "nvme" "rtsx_pci_sdmmc" ]; - kernelModules = [ ]; - luks.devices."cryptroot".device = "/dev/disk/by-uuid/6700d662-29a9-4ea5-8ca6-85d42550b3ab"; - }; - kernelModules = [ "kvm-intel" ]; - extraModulePackages = [ ]; - kernelPackages = pkgs.linuxPackages_latest; - loader = { - systemd-boot = { - enable = true; - configurationLimit = 3; - }; - efi.canTouchEfiVariables = true; - }; - }; + boot = { + initrd = { + availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; + kernelModules = []; + luks.devices."cryptroot".device = "/dev/disk/by-uuid/6700d662-29a9-4ea5-8ca6-85d42550b3ab"; + }; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + systemd-boot = { + enable = true; + configurationLimit = 3; + }; + efi.canTouchEfiVariables = true; + }; + }; - fileSystems = { - "/" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=nixos-root" "compress-force=zstd"]; - }; - "/nix" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress-force=zstd" ]; - }; - "/etc/NetworkManager" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=networkmanagerconfig" "compress-force=zstd" ]; - }; - "/etc/nixos" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=nixconfig" "compress-force=zstd" ]; - }; - "/srv" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=srv" "compress-force=zstd" ]; - }; - "/home" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=home" "compress-force=zstd" ]; - }; - "/srv/snapshots" = { - device = "/dev/disk/by-label/nixos-root"; - fsType = "btrfs"; - options = [ "subvol=snapshots" "compress-force=zstd" ]; - }; - "/boot" = { - device = "/dev/disk/by-uuid/4064-2D6C"; - fsType = "vfat"; - }; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=nixos-root" "compress-force=zstd"]; + }; + "/nix" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=nix" "compress-force=zstd"]; + }; + "/etc/NetworkManager" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=networkmanagerconfig" "compress-force=zstd"]; + }; + "/etc/nixos" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=nixconfig" "compress-force=zstd"]; + }; + "/srv" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=srv" "compress-force=zstd"]; + }; + "/home" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=home" "compress-force=zstd"]; + }; + "/srv/snapshots" = { + device = "/dev/disk/by-label/nixos-root"; + fsType = "btrfs"; + options = ["subvol=snapshots" "compress-force=zstd"]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/4064-2D6C"; + fsType = "vfat"; + }; + }; - swapDevices = [ ]; + 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 diff --git a/nix.nix b/nix.nix index 02fa333..da21492 100644 --- a/nix.nix +++ b/nix.nix @@ -1,11 +1,15 @@ -{ config, lib, pkgs, ... }: { - nix = { - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 3"; - }; - settings.auto-optimise-store = true; - }; + config, + lib, + pkgs, + ... +}: { + nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 3"; + }; + settings.auto-optimise-store = true; + }; } diff --git a/packages.nix b/packages.nix index 99d7373..6c80d9e 100644 --- a/packages.nix +++ b/packages.nix @@ -1,61 +1,62 @@ -{ config, pkgs, ... }: - { + config, + pkgs, + ... +}: { + environment.systemPackages = with pkgs; [ + neovim # edit nix files ;) + neofetch # a must-have + wget # download stuff + curl # download stuff – reloaded + restic # backups + thunderbird # emails + firefox # my browser + librewolf # privacy friendly firefox + ungoogled-chromium # the only chromium-based browser I'd ever use. + zsh # the one and only shell + element-desktop # chat + libreoffice # convert doc to pdf xD + keepassxc # passwords + gnome.gnome-keyring # to tired to migrate to kwallet + gnome.simple-scan # scanning, obiously + lsd # ls in good + jq # xdg-ninja requieres that + glow # markdown rendering + xdg-ninja # home cleaning + git # versioning + signal-desktop # the ecosystem is moving :( + mumble # voice chat + alejandra # nix code formatter - environment.systemPackages = with pkgs; [ - neovim # edit nix files ;) - neofetch # a must-have - wget # download stuff - curl # download stuff – reloaded - restic # backups - thunderbird # emails - firefox # my browser - librewolf # privacy friendly firefox - ungoogled-chromium # the only chromium-based browser I'd ever use. - zsh # the one and only shell - element-desktop # chat - libreoffice # convert doc to pdf xD - keepassxc # passwords - gnome.gnome-keyring # to tired to migrate to kwallet - gnome.simple-scan # scanning, obiously - lsd # ls in good - jq # xdg-ninja requieres that - glow # markdown rendering - xdg-ninja # home cleaning - git # versioning - signal-desktop # the ecosystem is moving :( - mumble # voice chat - - # SSH Stuff - openssh # ssh - mosh # ssh in great + # SSH Stuff + openssh # ssh + mosh # ssh in great - jdk17 # openjdk17 to satisfy mr.antoine - rustc # rust, obiously - cargo # cargo, the best compiler ever" - lf # a file manager - gnupg # encryprtion and so on - tor-browser-bundle-bin # tor-browser - tdesktop # another messenger (telegram) - libsForQt5.kdeconnect-kde # communicate with my phone - imagemagick # convertion and so on - #nerdfonts # nice fonts, u know - alacritty # terminal - konsole # terminal - + jdk17 # openjdk17 to satisfy mr.antoine + rustc # rust, obiously + cargo # cargo, the best compiler ever" + lf # a file manager + gnupg # encryprtion and so on + tor-browser-bundle-bin # tor-browser + tdesktop # another messenger (telegram) + libsForQt5.kdeconnect-kde # communicate with my phone + imagemagick # convertion and so on + #nerdfonts # nice fonts, u know + alacritty # terminal + konsole # terminal - zsh-you-should-use # reminder for aliasses - jetbrains.idea-community # Java-IDE - python39 # python programming language - _7zz # 7zip archive utility - sayonara # audioplayer - vlc # audio, again - nmap # network scanning - tree # tree view of directories - youtube-dl # download videos - mpv # play videos - texlive.combined.scheme-full # LaTeX - gparted # partitioning :( - musescore # notesetting program - ]; + zsh-you-should-use # reminder for aliasses + jetbrains.idea-community # Java-IDE + python39 # python programming language + _7zz # 7zip archive utility + sayonara # audioplayer + vlc # audio, again + nmap # network scanning + tree # tree view of directories + youtube-dl # download videos + mpv # play videos + texlive.combined.scheme-full # LaTeX + gparted # partitioning :( + musescore # notesetting program + ]; } diff --git a/users.nix b/users.nix index f63d188..cff3e1d 100644 --- a/users.nix +++ b/users.nix @@ -1,25 +1,26 @@ -{ config, pkgs, ... }: - { - users = { - mutableUsers = false; - users.sils = { - isNormalUser = true; - home = "/home/sils"; - shell = pkgs.zsh; - initialHashedPassword = "$y$j9T$r4578Hy9jZHmUH9uSr9OI.$SuR2anRq7EJ1gUJ6vi9qYmZrhLP.o3O5643IG6r5Ap/"; - extraGroups = [ "wheel" "networkmanager"]; - }; - users.cnnr = { - isNormalUser = true; - home = "/home/cnnr"; - shell = pkgs.zsh; - initialHashedPassword = "$y$j9T$NFz0d2coUOvl.hL3YRwEY0$8btvXUoWGWwo11ksdt8eIFUljCkpUe0YliEy7l0odU1"; - }; - }; - services.xserver.displayManager.autoLogin = { - enable = true; - user = "sils"; - }; - + config, + pkgs, + ... +}: { + users = { + mutableUsers = false; + users.sils = { + isNormalUser = true; + home = "/home/sils"; + shell = pkgs.zsh; + initialHashedPassword = "$y$j9T$r4578Hy9jZHmUH9uSr9OI.$SuR2anRq7EJ1gUJ6vi9qYmZrhLP.o3O5643IG6r5Ap/"; + extraGroups = ["wheel" "networkmanager"]; + }; + users.cnnr = { + isNormalUser = true; + home = "/home/cnnr"; + shell = pkgs.zsh; + initialHashedPassword = "$y$j9T$NFz0d2coUOvl.hL3YRwEY0$8btvXUoWGWwo11ksdt8eIFUljCkpUe0YliEy7l0odU1"; + }; + }; + services.xserver.displayManager.autoLogin = { + enable = true; + user = "sils"; + }; } diff --git a/zsh.nix b/zsh.nix index e2e3891..c51bcb7 100644 --- a/zsh.nix +++ b/zsh.nix @@ -1,46 +1,48 @@ -{ config, pkgs, ... }: - { - programs.zsh = { - enable = true; - syntaxHighlighting.enable = true; - autosuggestions.enable = true; - interactiveShellInit = '' - export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/ - export fpath=("$XDG_DATA_HOME/zsh/site-functions" $fpath) - HISTFILE="$XDG_STATE_HOME/zsh/history" + config, + pkgs, + ... +}: { + programs.zsh = { + enable = true; + syntaxHighlighting.enable = true; + autosuggestions.enable = true; + interactiveShellInit = '' + export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/ + export fpath=("$XDG_DATA_HOME/zsh/site-functions" $fpath) + HISTFILE="$XDG_STATE_HOME/zsh/history" + + plugins=(git) + + alias vim="nvim" + alias ls='lsd' + alias l='ls -l' + alias la='ls -a' + alias lla='ls -la' + alias lt='ls --tree' + alias rebackup='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd backup' + alias repreconf='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd' + alias b-del="sudo btrfs subv delet /srv/snapshots/home" + alias b-shot="sudo btrfs subvolume snapshot -r /home /srv/snapshots/home" + alias b-home='[ -d /srv/snapshots/home ] && sudo btrfs subvolume delete /srv/snapshots/home; sudo btrfs subvolume snapshot -r /home /srv/snapshots/home; sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache backup /srv/snapshots/home;' + alias r-clean="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache forget \ + --keep-weekly 7 \ + --keep-daily 7 \ + --keep-monthly 6 \ + --keep-yearly 10 \ + --keep-hourly 5 \ + --keep-tag prs" + alias r-prune="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache prune" + alias r-check="sudo restic -r /mnt/storage/backups --cache-dir /srv/.restic-cache --password-file ~/srv/.restic_pswd check" + alias zconf="vim ~/.config/zsh/.zshrc" + alias zenv="vim ~/.config/zsh/.zshenv" + alias o="xdg-open" + alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" - plugins=(git) - alias vim="nvim" - alias ls='lsd' - alias l='ls -l' - alias la='ls -a' - alias lla='ls -la' - alias lt='ls --tree' - alias rebackup='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd backup' - alias repreconf='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd' - alias b-del="sudo btrfs subv delet /srv/snapshots/home" - alias b-shot="sudo btrfs subvolume snapshot -r /home /srv/snapshots/home" - alias b-home='[ -d /srv/snapshots/home ] && sudo btrfs subvolume delete /srv/snapshots/home; sudo btrfs subvolume snapshot -r /home /srv/snapshots/home; sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache backup /srv/snapshots/home;' - alias r-clean="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache forget \ - --keep-weekly 7 \ - --keep-daily 7 \ - --keep-monthly 6 \ - --keep-yearly 10 \ - --keep-hourly 5 \ - --keep-tag prs" - alias r-prune="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache prune" - alias r-check="sudo restic -r /mnt/storage/backups --cache-dir /srv/.restic-cache --password-file ~/srv/.restic_pswd check" - alias zconf="vim ~/.config/zsh/.zshrc" - alias zenv="vim ~/.config/zsh/.zshenv" - alias o="xdg-open" - alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" - + source $ZSH/oh-my-zsh.sh + ''; - source $ZSH/oh-my-zsh.sh - ''; - - promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - }; + promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + }; } |