From eecb15a4ec753196eb47374e6a99616f6303bfff Mon Sep 17 00:00:00 2001 From: twoneis Date: Thu, 9 May 2024 20:17:37 +0200 Subject: [PATCH] restructure --- devices/akarso/default.nix | 16 +-- devices/akarso/hardware-config.nix | 47 ++++---- devices/akarso/options.nix | 10 ++ devices/creosote/default.nix | 17 --- devices/creosote/hardware-config.nix | 36 ------ devices/ellaca/default.nix | 6 - devices/ellaca/options.nix | 10 +- .../{system/audio.nix => audio/default.nix} | 2 +- modules/bluetooth/default.nix | 8 ++ colors.nix => modules/colors.nix | 0 .../containers.nix => containers/default.nix} | 2 +- modules/{system => }/default.nix | 104 ++++++++-------- .../distrobox.nix => distrobox/default.nix} | 0 .../{system/games.nix => games/default.nix} | 0 modules/{system => }/gnome/default.nix | 2 +- modules/{system => }/home/browser/default.nix | 0 .../email => home/communication}/default.nix | 7 +- modules/{server => }/home/default.nix | 21 ++-- .../{system => }/home/niri-setup/default.nix | 2 +- .../programs}/alacritty-config.nix | 0 .../home/media => home/programs}/default.nix | 16 +++ modules/{system => }/home/themes/default.nix | 14 +++ modules/home/utils/default.nix | 112 ++++++++++++++++++ .../{system/home/gdb => home/utils}/gdbinit | 0 .../editor => home/utils}/helix-config.nix | 0 .../editor => home/utils}/helix-languages.nix | 0 modules/{system => }/niri/default.nix | 2 +- .../nvidia.nix => modules/nvidia/default.nix | 1 - modules/server/access-point.nix | 11 -- modules/server/calibre.nix | 5 - modules/server/default.nix | 73 ------------ modules/server/home/server-utils/default.nix | 43 ------- modules/system/fonts.nix | 16 --- modules/system/home/art/default.nix | 5 - modules/system/home/chat/default.nix | 6 - modules/system/home/cursor/default.nix | 15 --- modules/system/home/default.nix | 45 ------- modules/system/home/direnv/default.nix | 9 -- modules/system/home/discord/default.nix | 5 - modules/system/home/editor/default.nix | 9 -- modules/system/home/gdb/default.nix | 7 -- modules/system/home/git/default.nix | 16 --- .../system/home/niri-setup/waybar-style.css | 1 - modules/system/home/notes/default.nix | 5 - modules/system/home/shell/default.nix | 41 ------- modules/system/home/terminal/default.nix | 11 -- modules/system/home/utils/default.nix | 45 ------- modules/{system/virt.nix => virt/default.nix} | 0 options.nix | 22 ++-- outputs.nix | 20 +--- 50 files changed, 281 insertions(+), 564 deletions(-) delete mode 100644 devices/creosote/default.nix delete mode 100644 devices/creosote/hardware-config.nix rename modules/{system/audio.nix => audio/default.nix} (82%) create mode 100644 modules/bluetooth/default.nix rename colors.nix => modules/colors.nix (100%) rename modules/{system/containers.nix => containers/default.nix} (58%) rename modules/{system => }/default.nix (52%) rename modules/{system/distrobox.nix => distrobox/default.nix} (100%) rename modules/{system/games.nix => games/default.nix} (100%) rename modules/{system => }/gnome/default.nix (90%) rename modules/{system => }/home/browser/default.nix (100%) rename modules/{system/home/email => home/communication}/default.nix (60%) rename modules/{server => }/home/default.nix (58%) rename modules/{system => }/home/niri-setup/default.nix (98%) rename modules/{system/home/terminal => home/programs}/alacritty-config.nix (100%) rename modules/{system/home/media => home/programs}/default.nix (52%) rename modules/{system => }/home/themes/default.nix (55%) create mode 100644 modules/home/utils/default.nix rename modules/{system/home/gdb => home/utils}/gdbinit (100%) rename modules/{system/home/editor => home/utils}/helix-config.nix (100%) rename modules/{system/home/editor => home/utils}/helix-languages.nix (100%) rename modules/{system => }/niri/default.nix (98%) rename devices/ellaca/nvidia.nix => modules/nvidia/default.nix (99%) delete mode 100644 modules/server/access-point.nix delete mode 100644 modules/server/calibre.nix delete mode 100644 modules/server/default.nix delete mode 100644 modules/server/home/server-utils/default.nix delete mode 100644 modules/system/fonts.nix delete mode 100644 modules/system/home/art/default.nix delete mode 100644 modules/system/home/chat/default.nix delete mode 100644 modules/system/home/cursor/default.nix delete mode 100644 modules/system/home/default.nix delete mode 100644 modules/system/home/direnv/default.nix delete mode 100644 modules/system/home/discord/default.nix delete mode 100644 modules/system/home/editor/default.nix delete mode 100644 modules/system/home/gdb/default.nix delete mode 100644 modules/system/home/git/default.nix delete mode 100644 modules/system/home/niri-setup/waybar-style.css delete mode 100644 modules/system/home/notes/default.nix delete mode 100644 modules/system/home/shell/default.nix delete mode 100644 modules/system/home/terminal/default.nix delete mode 100644 modules/system/home/utils/default.nix rename modules/{system/virt.nix => virt/default.nix} (100%) diff --git a/devices/akarso/default.nix b/devices/akarso/default.nix index 1053aaf..c259c24 100644 --- a/devices/akarso/default.nix +++ b/devices/akarso/default.nix @@ -6,17 +6,14 @@ networking.hostName = "akarso"; - # Add user to surface control group for surface linux users.users.twoneis.extraGroups = [ "surface-control" ]; - # Bootloader. boot.loader = { systemd-boot = { enable = true; }; }; - # Enable OpenGL hardware.opengl = { enable = true; driSupport = true; @@ -36,17 +33,6 @@ surface-control.enable = true; }; - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - # 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 = "23.05"; # Did you read the comment? + system.stateVersion = "23.05"; } diff --git a/devices/akarso/hardware-config.nix b/devices/akarso/hardware-config.nix index 175800c..82148b7 100644 --- a/devices/akarso/hardware-config.nix +++ b/devices/akarso/hardware-config.nix @@ -1,36 +1,31 @@ -{ config, lib, modulesPath, ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4ecc3b27-016f-4416-a819-bd0998fc993f"; - fsType = "ext4"; +{ config, lib, ... }: { + boot = { + initrd = { + availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; }; - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/0721-3632"; - fsType = "vfat"; - }; - - fileSystems."/sd" = { - device = "/dev/disk/by-uuid/b3faf000-8792-4fca-916a-5965c0cb8186"; - fsType = "ext4"; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/4ecc3b27-016f-4416-a819-bd0998fc993f"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/0721-3632"; + fsType = "vfat"; + }; + "/ext" = { + device = "/dev/disk/by-uuid/b3faf000-8792-4fca-916a-5965c0cb8186"; + fsType = "ext4"; + }; }; swapDevices = [ { device = "/dev/disk/by-uuid/b35abec3-ff20-4b3b-b953-e36f2df719cb"; } ]; - # 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.wlp0s20f3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/devices/akarso/options.nix b/devices/akarso/options.nix index d80dc46..fdfe9ba 100644 --- a/devices/akarso/options.nix +++ b/devices/akarso/options.nix @@ -1,6 +1,16 @@ { ... }: { + minimal = false; + full = true; + + withAudio = true; + withBluetooth = true; + withNvidia = false; + withNiri = true; withGnome = false; + withVM = false; + withContainers = false; withDistrobox = false; + withGames = false; } diff --git a/devices/creosote/default.nix b/devices/creosote/default.nix deleted file mode 100644 index bb6a63f..0000000 --- a/devices/creosote/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ pkgs, ... }: { - imports = [ - ./hardware-config.nix - ]; - - boot.kernelPackages = pkgs.linuxPackages_zen; - - networking.hostName = "creosote"; - - boot.loader = { - systemd-boot = { - enable = true; - }; - }; - - system.stateVersion = "24.05"; -} diff --git a/devices/creosote/hardware-config.nix b/devices/creosote/hardware-config.nix deleted file mode 100644 index 242a89f..0000000 --- a/devices/creosote/hardware-config.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, modulesPath, ... }: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "ums_realtek" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/4a496297-dd6f-42d8-9e1f-56149a0166ea"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D976-03E3"; - fsType = "vfat"; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/3a785c6a-7f59-4647-9a84-f2e65d03997b"; } - ]; - - # 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.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/devices/ellaca/default.nix b/devices/ellaca/default.nix index 285cc3c..a891d19 100644 --- a/devices/ellaca/default.nix +++ b/devices/ellaca/default.nix @@ -1,7 +1,6 @@ { pkgs, ... }: { imports = [ ./hardware-config.nix - ./nvidia.nix ./options.nix ]; @@ -30,11 +29,6 @@ driSupport32Bit = true; }; - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - # 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 diff --git a/devices/ellaca/options.nix b/devices/ellaca/options.nix index 94a8119..9cce6c7 100644 --- a/devices/ellaca/options.nix +++ b/devices/ellaca/options.nix @@ -1,8 +1,16 @@ { ... }: { + minimal = false; + full = true; + + withAudio = true; + withBluetooth = true; + withNvidia = true; + withNiri = true; withGnome = false; - withNvidia = true; + withVM = false; + withContainers = false; withDistrobox = false; withGames = false; } diff --git a/modules/system/audio.nix b/modules/audio/default.nix similarity index 82% rename from modules/system/audio.nix rename to modules/audio/default.nix index 3d387d0..ab05378 100644 --- a/modules/system/audio.nix +++ b/modules/audio/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ lib, config, ... }: lib.mkIf(config.withAudio) { # Enable sound with pipewire. sound.enable = false; hardware.pulseaudio.enable = false; diff --git a/modules/bluetooth/default.nix b/modules/bluetooth/default.nix new file mode 100644 index 0000000..bf21b68 --- /dev/null +++ b/modules/bluetooth/default.nix @@ -0,0 +1,8 @@ +{ lib, config, ... }: lib.mkIf(config.withBluetooth) { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + services.blueman.enable = true; +} diff --git a/colors.nix b/modules/colors.nix similarity index 100% rename from colors.nix rename to modules/colors.nix diff --git a/modules/system/containers.nix b/modules/containers/default.nix similarity index 58% rename from modules/system/containers.nix rename to modules/containers/default.nix index 37364bd..dc0d198 100644 --- a/modules/system/containers.nix +++ b/modules/containers/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ lib, config, ... }: lib.mkIf(config.withContainers) { virtualisation.podman = { enable = true; dockerCompat = true; diff --git a/modules/system/default.nix b/modules/default.nix similarity index 52% rename from modules/system/default.nix rename to modules/default.nix index d97ee30..2b70d19 100644 --- a/modules/system/default.nix +++ b/modules/default.nix @@ -4,67 +4,51 @@ { inputs, pkgs, ... }: { imports = [ - ./audio.nix - ./containers.nix - ./distrobox.nix - ./fonts.nix - ./games.nix + ./audio + ./bluetooth + ./containers + ./distrobox + ./games ./gnome + ./home ./niri - ./virt.nix + ./nvidia + ./virt ]; - # Overlays for nixpkgs - nixpkgs.overlays = [ - inputs.nur.overlay - ]; - - # Needed for some nautilus features like auto-mount and trash - services.gvfs.enable = true; - - # 57621: spotifyd - networking.firewall.allowedTCPPorts = [ 57621 ]; - - services.xserver.displayManager.gdm.enable = true; - - # Wayland in electron - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - - networking.extraHosts = - '' - 10.10.11.245 surveillance.htb - ''; - - nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"]; - - # Allow packages from nixpkgs - nixpkgs.config = { - allowUnfree = true; + nixpkgs = { + overlays = [ + inputs.nur.overlay + ]; + config = { + allowUnfree = true; + }; }; - #Optimise nix store nix = { + nixPath = ["nixpkgs=${inputs.nixpkgs}"]; gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 1w"; }; - settings.auto-optimise-store = true; + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; }; - # Enable nix flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Disable documentation documentation.nixos.enable = false; - # Enable networking - networking.networkmanager.enable = true; + networking = { + networkmanager.enable = true; + extraHosts = + '' + 10.10.11.245 surveillance.htb + ''; + }; - # Set your time zone. time.timeZone = "Europe/Amsterdam"; - - # Select internationalisation properties. i18n = { defaultLocale = "en_US.UTF-8"; @@ -81,35 +65,45 @@ }; }; - # Configure xserver + fonts = { + packages = with pkgs; [ + alegreya + alegreya-sans + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + ]; + fontconfig = { + defaultFonts = { + serif = [ "Alegreya" ]; + sansSerif = [ "Alegreya Sans" ]; + monospace = [ "Fira Code Nerd Font" ]; + }; + }; + }; + services.xserver = { enable = true; excludePackages = [ pkgs.xterm ]; + displayManager.gdm.enable = true; + xkb = { + layout = "us"; + variant = ""; + }; }; - # Configure xkb - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable CUPS to print documents. services.printing.enable = false; - # Security security.rtkit.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + users.users.twoneis = { isNormalUser = true; description = "twoneis"; extraGroups = [ "networkmanager" "wheel" ]; }; - # Use zsh programs.zsh.enable = true; users.defaultUserShell = pkgs.zsh; - # Allow swaylock to PAM authentication security.pam.services.swaylock = {}; } diff --git a/modules/system/distrobox.nix b/modules/distrobox/default.nix similarity index 100% rename from modules/system/distrobox.nix rename to modules/distrobox/default.nix diff --git a/modules/system/games.nix b/modules/games/default.nix similarity index 100% rename from modules/system/games.nix rename to modules/games/default.nix diff --git a/modules/system/gnome/default.nix b/modules/gnome/default.nix similarity index 90% rename from modules/system/gnome/default.nix rename to modules/gnome/default.nix index c3201f1..3dcd13c 100644 --- a/modules/system/gnome/default.nix +++ b/modules/gnome/default.nix @@ -1,7 +1,7 @@ { pkgs, lib, config, ... }: lib.mkIf (config.withGnome) { # Enable the GNOME Desktop Environment. services.xserver.desktopManager.gnome.enable = true; - # Don't pull unnecessary packages + # Don't install unnecessary packages services.gnome.core-utilities.enable = false; environment.gnome.excludePackages = [ pkgs.gnome-tour ]; diff --git a/modules/system/home/browser/default.nix b/modules/home/browser/default.nix similarity index 100% rename from modules/system/home/browser/default.nix rename to modules/home/browser/default.nix diff --git a/modules/system/home/email/default.nix b/modules/home/communication/default.nix similarity index 60% rename from modules/system/home/email/default.nix rename to modules/home/communication/default.nix index 76e0bcf..dc5b4ea 100644 --- a/modules/system/home/email/default.nix +++ b/modules/home/communication/default.nix @@ -1,4 +1,9 @@ -{ ... }: { +{ pkgs, ... }: { + home.packages = with pkgs; [ + signal-desktop + fractal + ]; + programs.thunderbird = { enable = true; profiles = { diff --git a/modules/server/home/default.nix b/modules/home/default.nix similarity index 58% rename from modules/server/home/default.nix rename to modules/home/default.nix index a35a03a..b5b047e 100644 --- a/modules/server/home/default.nix +++ b/modules/home/default.nix @@ -1,15 +1,20 @@ -{ ... }: { +{ config, ... }: let + imp = if config.minimal then [ + ./browser + ./communication + ./niri-setup + ./programs + ./themes + ./utils + ] else [ + ./utils + ]; +in { home-manager = { useGlobalPkgs = true; useUserPackages = true; users.twoneis = { - imports = [ - ../../system/home/direnv - ../../system/home/editor - ../../system/home/git - ../../system/home/shell - ./server-utils - ]; + imports = imp; home = { username = "twoneis"; diff --git a/modules/system/home/niri-setup/default.nix b/modules/home/niri-setup/default.nix similarity index 98% rename from modules/system/home/niri-setup/default.nix rename to modules/home/niri-setup/default.nix index 099aff6..29ac02e 100644 --- a/modules/system/home/niri-setup/default.nix +++ b/modules/home/niri-setup/default.nix @@ -1,5 +1,5 @@ { lib, osConfig, pkgs, ... }: let - theme = import ../../../../colors.nix; + theme = import ../../colors.nix; in lib.mkIf (osConfig.withNiri) { programs.fuzzel= { enable = true; diff --git a/modules/system/home/terminal/alacritty-config.nix b/modules/home/programs/alacritty-config.nix similarity index 100% rename from modules/system/home/terminal/alacritty-config.nix rename to modules/home/programs/alacritty-config.nix diff --git a/modules/system/home/media/default.nix b/modules/home/programs/default.nix similarity index 52% rename from modules/system/home/media/default.nix rename to modules/home/programs/default.nix index 4f0f6e2..7c1e275 100644 --- a/modules/system/home/media/default.nix +++ b/modules/home/programs/default.nix @@ -1,12 +1,22 @@ { pkgs, osConfig, ... }: { home.packages = with pkgs; [ + krita loupe + gnome.nautilus ]; + # Needed for some features in nautilus such as auto-mounting and trash + osConfig.services.gvfs.enable = true; + + programs.pandoc = { + enable = true; + }; + programs.mpv = { enable = true; }; + osConfig.networking.firewall.allowedTCPPorts = [ 57621 ]; services.spotifyd = { enable = true; settings = { @@ -19,4 +29,10 @@ }; }; }; + + programs.alacritty = { + enable = true; + settings = import ./alacritty-config.nix; + }; + } diff --git a/modules/system/home/themes/default.nix b/modules/home/themes/default.nix similarity index 55% rename from modules/system/home/themes/default.nix rename to modules/home/themes/default.nix index 5cd42ae..c38002f 100644 --- a/modules/system/home/themes/default.nix +++ b/modules/home/themes/default.nix @@ -30,4 +30,18 @@ }; }; }; + + home.pointerCursor = let getFrom = url: hash: name: { + gtk.enable = true; + x11.enable = true; + name = name; + size = 24; + package = pkgs.runCommand "moveUp" {} '' + mkdir -p $out/share/icons + ln -s ${pkgs.fetchzip{ + url = url; + hash = hash; + }} $out/share/icons/${name} + ''; + }; in getFrom "https://github.com/rose-pine/cursor/releases/download/v1.1.0/BreezeX-RosePine-Linux.tar.xz" "sha256-t5xwAPGhuQUfGThedLsmtZEEp1Ljjo3Udhd5Ql3O67c=" "BreezX-RosePine-Linux"; } diff --git a/modules/home/utils/default.nix b/modules/home/utils/default.nix new file mode 100644 index 0000000..b7fd68c --- /dev/null +++ b/modules/home/utils/default.nix @@ -0,0 +1,112 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + man-pages + man-pages-posix + tree + zip + unzip + thefuck + ]; + + home.file = { + ".gdbinit" = { + source = ./gdbinit; + }; + }; + + programs.man = { + enable = true; + }; + + programs.git = { + enable = true; + userName = "twoneis"; + userEmail = "sanjay29@sapura.de"; + extraConfig = { + init.defaultBranch = "main"; + push.autoSetupRemote = true; + }; + }; + + programs.gh = { + enable = true; + gitCredentialHelper.enable = true; + }; + + programs.helix = { + enable = true; + defaultEditor = true; + extraPackages = with pkgs; [ nil marksman ]; + settings = import ./helix-config.nix; + languages = import ./helix-languages.nix; + }; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv.enable = true; + }; + + programs.bottom = { + enable = true; + }; + + programs.lsd = { + enable = true; + enableAliases = true; + }; + + programs.hyfetch = { + enable = true; + settings = { + preset = "transgender"; + mode = "rgb"; + light_dark = "dark"; + lightness = 0.65; + color_align = { + mode = "horizontal"; + custom_colors = []; + fore_back = null; + }; + backend = "neofetch"; + args = null; + distro = "nixos_old"; + pride_month_shown = []; + pride_month_disable = false; + }; + }; + + home.shellAliases = { + ga = "git add"; + gc = "git commit -m "; + gca = "git add -A && git commit -am "; + gs = "git stash"; + gsp = "git stash pop"; + gp = "git push"; + gpl = "git pull --recurse-submodules"; + gst = "git status"; + + repl = "nix repl --expr 'import {}'"; + + nrb = "sudo nixos-rebuild switch --flake . --cores 0"; + nd = "nix develop"; + + neofetch = "hyfetch"; + }; + + # For direnv and shell aliases the shell needs to be managed by hm + programs.bash.enable = true; + + programs.zsh = { + enable = true; + autosuggestion.enable = true; + enableVteIntegration = true; + history.ignoreAllDups = true; + historySubstringSearch.enable = true; + oh-my-zsh = { + enable = true; + plugins = [ "git" "thefuck" ]; + theme = "bira"; + }; + }; +} diff --git a/modules/system/home/gdb/gdbinit b/modules/home/utils/gdbinit similarity index 100% rename from modules/system/home/gdb/gdbinit rename to modules/home/utils/gdbinit diff --git a/modules/system/home/editor/helix-config.nix b/modules/home/utils/helix-config.nix similarity index 100% rename from modules/system/home/editor/helix-config.nix rename to modules/home/utils/helix-config.nix diff --git a/modules/system/home/editor/helix-languages.nix b/modules/home/utils/helix-languages.nix similarity index 100% rename from modules/system/home/editor/helix-languages.nix rename to modules/home/utils/helix-languages.nix diff --git a/modules/system/niri/default.nix b/modules/niri/default.nix similarity index 98% rename from modules/system/niri/default.nix rename to modules/niri/default.nix index 20765eb..c8c5717 100644 --- a/modules/system/niri/default.nix +++ b/modules/niri/default.nix @@ -79,7 +79,7 @@ spawn-at-startup = [ { command = ["waybar"]; } - { command = ["swaybg" "-i" "${../../../wallpaper/wallpaper.png}" "-m" "fill"]; } + { command = ["swaybg" "-i" "${../../wallpaper/wallpaper.png}" "-m" "fill"]; } { command = ["pamixer" "--set-volume" "0"]; } { command = ["brightnessctl" "s" "50%"]; } { command = ["systemctl" "--user" "restart" "spotifyd.service"]; } diff --git a/devices/ellaca/nvidia.nix b/modules/nvidia/default.nix similarity index 99% rename from devices/ellaca/nvidia.nix rename to modules/nvidia/default.nix index 5c5c7be..acd5d0b 100644 --- a/devices/ellaca/nvidia.nix +++ b/modules/nvidia/default.nix @@ -10,5 +10,4 @@ nvidiaSettings = false; package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta; }; - } diff --git a/modules/server/access-point.nix b/modules/server/access-point.nix deleted file mode 100644 index 0901bf2..0000000 --- a/modules/server/access-point.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: { - services.create_ap = { - enable = true; - settings = { - INTERNET_IFACE = "enp2s0"; - WIFI_IFACE = "wlp1s0"; - SSID = "home"; - PASSPHRASE = "FCKask4net"; - }; - }; -} diff --git a/modules/server/calibre.nix b/modules/server/calibre.nix deleted file mode 100644 index b12ac74..0000000 --- a/modules/server/calibre.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: { - services.calibre-server = { - enable = true; - }; -} diff --git a/modules/server/default.nix b/modules/server/default.nix deleted file mode 100644 index e04ce17..0000000 --- a/modules/server/default.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ pkgs, ... }: { - imports = [ - # ./access-point.nix - ./calibre.nix - ]; - - # Allow ssh access - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = true; - KbdInteractiveAuthentication = true; - }; - }; - - # Allow packages from nixpkgs - nixpkgs.config = { - allowUnfree = true; - }; - - #Optimise nix store - nix = { - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - settings.auto-optimise-store = true; - }; - - # Enable nix flakes - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - - # Disable documentation - documentation.nixos.enable = false; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "Europe/Amsterdam"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_US.UTF-8"; - - extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - }; - - # Security - security.rtkit.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.twoneis = { - isNormalUser = true; - description = "twoneis"; - extraGroups = [ "networkmanager" "wheel" ]; - }; - - # Use zsh - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; -} diff --git a/modules/server/home/server-utils/default.nix b/modules/server/home/server-utils/default.nix deleted file mode 100644 index d941fd0..0000000 --- a/modules/server/home/server-utils/default.nix +++ /dev/null @@ -1,43 +0,0 @@ - -{ pkgs, ... }: { - home.packages = with pkgs; [ - man-pages - man-pages-posix - tree - zip - unzip - ]; - - programs.man = { - enable = true; - }; - - programs.bottom = { - enable = true; - }; - - programs.lsd = { - enable = true; - enableAliases = true; - }; - - programs.hyfetch = { - enable = true; - settings = { - preset = "transgender"; - mode = "rgb"; - light_dark = "dark"; - lightness = 0.65; - color_align = { - mode = "horizontal"; - custom_colors = []; - fore_back = null; - }; - backend = "neofetch"; - args = null; - distro = "nixos_old"; - pride_month_shown = []; - pride_month_disable = false; - }; - }; -} diff --git a/modules/system/fonts.nix b/modules/system/fonts.nix deleted file mode 100644 index 5331921..0000000 --- a/modules/system/fonts.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: { - # Configure fonts - fonts.packages = with pkgs; [ - alegreya - alegreya-sans - (nerdfonts.override { fonts = [ "FiraCode" ]; }) - ]; - - fonts.fontconfig = { - defaultFonts = { - serif = [ "Alegreya" ]; - sansSerif = [ "Alegreya Sans" ]; - monospace = [ "Fira Code Nerd Font" ]; - }; - }; -} diff --git a/modules/system/home/art/default.nix b/modules/system/home/art/default.nix deleted file mode 100644 index 75c522c..0000000 --- a/modules/system/home/art/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - krita - ]; -} diff --git a/modules/system/home/chat/default.nix b/modules/system/home/chat/default.nix deleted file mode 100644 index a19f948..0000000 --- a/modules/system/home/chat/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - signal-desktop - fractal - ]; -} diff --git a/modules/system/home/cursor/default.nix b/modules/system/home/cursor/default.nix deleted file mode 100644 index e753253..0000000 --- a/modules/system/home/cursor/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ... }: { - home.pointerCursor = let getFrom = url: hash: name: { - gtk.enable = true; - x11.enable = true; - name = name; - size = 24; - package = pkgs.runCommand "moveUp" {} '' - mkdir -p $out/share/icons - ln -s ${pkgs.fetchzip{ - url = url; - hash = hash; - }} $out/share/icons/${name} - ''; - }; in getFrom "https://github.com/rose-pine/cursor/releases/download/v1.1.0/BreezeX-RosePine-Linux.tar.xz" "sha256-t5xwAPGhuQUfGThedLsmtZEEp1Ljjo3Udhd5Ql3O67c=" "BreezX-RosePine-Linux"; -} diff --git a/modules/system/home/default.nix b/modules/system/home/default.nix deleted file mode 100644 index e4050d0..0000000 --- a/modules/system/home/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ ... }: { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.twoneis = { - imports = [ - ./art - ./browser - ./chat - ./cursor - ./discord - ./direnv - ./editor - ./email - ./gdb - ./git - ./media - ./niri-setup - ./notes - ./shell - ./terminal - ./themes - ./utils - ]; - - home = { - username = "twoneis"; - homeDirectory = "/home/twoneis"; - - stateVersion = "22.11"; - }; - - programs.home-manager.enable = true; - - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; - }; - }; - }; - }; -} diff --git a/modules/system/home/direnv/default.nix b/modules/system/home/direnv/default.nix deleted file mode 100644 index 5ad1428..0000000 --- a/modules/system/home/direnv/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - programs.direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; - }; - - programs.bash.enable = true; -} diff --git a/modules/system/home/discord/default.nix b/modules/system/home/discord/default.nix deleted file mode 100644 index 01cdb33..0000000 --- a/modules/system/home/discord/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - dorion - ]; -} diff --git a/modules/system/home/editor/default.nix b/modules/system/home/editor/default.nix deleted file mode 100644 index 4757ed8..0000000 --- a/modules/system/home/editor/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: { - programs.helix = { - enable = true; - defaultEditor = true; - extraPackages = with pkgs; [ nil marksman ]; - settings = import ./helix-config.nix; - languages = import ./helix-languages.nix; - }; -} diff --git a/modules/system/home/gdb/default.nix b/modules/system/home/gdb/default.nix deleted file mode 100644 index a97aba6..0000000 --- a/modules/system/home/gdb/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: { - home.file = { - ".gdbinit" = { - source = ./gdbinit; - }; - }; -} diff --git a/modules/system/home/git/default.nix b/modules/system/home/git/default.nix deleted file mode 100644 index 4a4c816..0000000 --- a/modules/system/home/git/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: { - programs.git = { - enable = true; - userName = "twoneis"; - userEmail = "sanjay29@sapura.de"; - extraConfig = { - init.defaultBranch = "main"; - push.autoSetupRemote = true; - }; - }; - - programs.gh = { - enable = true; - gitCredentialHelper.enable = true; - }; -} diff --git a/modules/system/home/niri-setup/waybar-style.css b/modules/system/home/niri-setup/waybar-style.css deleted file mode 100644 index 8b13789..0000000 --- a/modules/system/home/niri-setup/waybar-style.css +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/system/home/notes/default.nix b/modules/system/home/notes/default.nix deleted file mode 100644 index e026a0e..0000000 --- a/modules/system/home/notes/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: { - programs.pandoc = { - enable = true; - }; -} diff --git a/modules/system/home/shell/default.nix b/modules/system/home/shell/default.nix deleted file mode 100644 index ae6e560..0000000 --- a/modules/system/home/shell/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - thefuck - git - ]; - - home.shellAliases = { - ga = "git add"; - gc = "git commit -m "; - gca = "git add -A && git commit -am "; - gs = "git stash"; - gsp = "git stash pop"; - gp = "git push"; - gpl = "git pull --recurse-submodules"; - gst = "git status"; - - repl = "nix repl --expr 'import {}'"; - - nrb = "sudo nixos-rebuild switch --flake . --cores 0"; - nd = "nix develop"; - - neofetch = "hyfetch"; - }; - - programs.bash = { - enable = true; - }; - - programs.zsh = { - enable = true; - autosuggestion.enable = true; - enableVteIntegration = true; - history.ignoreAllDups = true; - historySubstringSearch.enable = true; - oh-my-zsh = { - enable = true; - plugins = [ "git" "thefuck" ]; - theme = "bira"; - }; - }; -} diff --git a/modules/system/home/terminal/default.nix b/modules/system/home/terminal/default.nix deleted file mode 100644 index ea95587..0000000 --- a/modules/system/home/terminal/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - man-pages - man-pages-posix - ]; - - programs.alacritty = { - enable = true; - settings = import ./alacritty-config.nix; - }; -} diff --git a/modules/system/home/utils/default.nix b/modules/system/home/utils/default.nix deleted file mode 100644 index abff376..0000000 --- a/modules/system/home/utils/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs, ... }: { - home.packages = with pkgs; [ - man-pages - man-pages-posix - gnome.nautilus - baobab - tree - zip - unzip - blueberry - ]; - - programs.man = { - enable = true; - }; - - programs.bottom = { - enable = true; - }; - - programs.lsd = { - enable = true; - enableAliases = true; - }; - - programs.hyfetch = { - enable = true; - settings = { - preset = "transgender"; - mode = "rgb"; - light_dark = "dark"; - lightness = 0.65; - color_align = { - mode = "horizontal"; - custom_colors = []; - fore_back = null; - }; - backend = "neofetch"; - args = null; - distro = "nixos_old"; - pride_month_shown = []; - pride_month_disable = false; - }; - }; -} diff --git a/modules/system/virt.nix b/modules/virt/default.nix similarity index 100% rename from modules/system/virt.nix rename to modules/virt/default.nix diff --git a/options.nix b/options.nix index 264f767..ca6d0b9 100644 --- a/options.nix +++ b/options.nix @@ -1,10 +1,18 @@ { lib, ... }: { - options = { - withNiri = with lib; mkEnableOption "Enable niri compositor"; - withGnome = with lib; mkEnableOption "Enable gnome DE"; - withNvidia = with lib; mkEnableOption "Enable proprietary nvidia drivers"; - withVM = with lib; mkEnableOption "Enable VM related configuration"; - withDistrobox = with lib; mkEnableOption "Enable Distrobox"; - withGames = with lib; mkEnableOption "Enable games"; + options = with lib; { + minimal = mkEnableOption "Minimal setup with only cli utilities"; + full = mkEnableOption "Full setup with all programs and themes"; + + withAudio = mkEnableOption "Enable support for audio"; + withBluetooth = mkEnableOption "Enable bluetooth"; + withNvidia = mkEnableOption "Enable proprietary nvidia drivers"; + + withNiri = mkEnableOption "Enable niri compositor"; + withGnome =mkEnableOption "Enable gnome DE"; + + withVM = mkEnableOption "Enable VM related configuration"; + withContainers = mkEnableOption "Enable container support"; + withDistrobox = mkEnableOption "Enable Distrobox"; + withGames = mkEnableOption "Enable games"; }; } diff --git a/outputs.nix b/outputs.nix index 6cf25e0..821e4d5 100644 --- a/outputs.nix +++ b/outputs.nix @@ -9,8 +9,7 @@ }; modules = [ ./devices/ellaca - ./modules/system - ./modules/system/home + ./modules ./options.nix niri.nixosModules.niri home-manager.nixosModules.home-manager @@ -25,27 +24,12 @@ }; modules = [ ./devices/akarso - ./modules/system - ./modules/system/home + ./modules ./options.nix nixos-hardware.nixosModules.microsoft-surface-pro-intel niri.nixosModules.niri home-manager.nixosModules.home-manager ]; }; - - # Zotac Mini - # (Name should be used for an ARM device instead once i get one) - creosote = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { - inherit inputs; - }; - modules = [ - ./devices/creosote - ./modules/server - home-manager.nixosModules.home-manager - ]; - }; }; }