From 20a3fe453846e5b47b3c5f027cb76a0e17b9685d Mon Sep 17 00:00:00 2001 From: GHOSCHT <31184695+GHOSCHT@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:20:40 +0100 Subject: [PATCH] Switch to nix-starter-configs template --- flake.lock | 186 +----------- flake.nix | 134 +++++---- home-manager/home.nix | 69 +++++ hosts/configuration.nix | 242 ---------------- hosts/convertible/default.nix | 82 ------ hosts/convertible/hardware-configuration.nix | 46 --- hosts/default.nix | 79 ----- hosts/desktop/default.nix | 71 ----- hosts/desktop/hardware-configuration.nix | 43 --- modules/coding/android-studio.nix | 19 -- modules/coding/default.nix | 6 - modules/coding/intellij.nix | 16 - modules/coding/nvim.nix | 30 -- modules/coding/vscode.nix | 87 ------ modules/desktops/awesome.nix | 82 ------ modules/desktops/default.nix | 6 - modules/desktops/gnome.nix | 66 ----- modules/desktops/hyprland.nix | 289 ------------------- modules/desktops/kde.nix | 52 ---- modules/hardware/nvidia.nix | 17 -- modules/home-manager/default.nix | 6 + modules/nixos/default.nix | 6 + modules/programs/alacritty.nix | 14 - modules/programs/games.nix | 24 -- modules/programs/librewolf.nix | 25 -- modules/secrets/gnome-keyring.nix | 11 - modules/secrets/gpg.nix | 30 -- modules/services/avahi.nix | 16 - modules/services/default.nix | 1 - modules/services/easyeffects.nix | 15 - modules/shell/default.nix | 5 - modules/shell/fish.nix | 30 -- modules/shell/git.nix | 24 -- modules/shell/zsh.nix | 59 ---- modules/theming/cursor.nix | 44 --- modules/theming/default.nix | 5 - modules/theming/gtk.nix | 20 -- modules/theming/qt.nix | 31 -- modules/virtualization/docker.nix | 18 -- modules/virtualization/qemu.nix | 42 --- nix/home.nix | 29 -- nixos/configuration.nix | 113 ++++++++ nixos/hardware-configuration.nix | 10 + overlays/default.nix | 23 ++ pkgs/default.nix | 5 + 45 files changed, 314 insertions(+), 1914 deletions(-) create mode 100644 home-manager/home.nix delete mode 100644 hosts/configuration.nix delete mode 100644 hosts/convertible/default.nix delete mode 100644 hosts/convertible/hardware-configuration.nix delete mode 100644 hosts/default.nix delete mode 100644 hosts/desktop/default.nix delete mode 100644 hosts/desktop/hardware-configuration.nix delete mode 100644 modules/coding/android-studio.nix delete mode 100644 modules/coding/default.nix delete mode 100644 modules/coding/intellij.nix delete mode 100644 modules/coding/nvim.nix delete mode 100644 modules/coding/vscode.nix delete mode 100644 modules/desktops/awesome.nix delete mode 100644 modules/desktops/default.nix delete mode 100644 modules/desktops/gnome.nix delete mode 100644 modules/desktops/hyprland.nix delete mode 100644 modules/desktops/kde.nix delete mode 100644 modules/hardware/nvidia.nix create mode 100644 modules/home-manager/default.nix create mode 100644 modules/nixos/default.nix delete mode 100644 modules/programs/alacritty.nix delete mode 100644 modules/programs/games.nix delete mode 100644 modules/programs/librewolf.nix delete mode 100644 modules/secrets/gnome-keyring.nix delete mode 100644 modules/secrets/gpg.nix delete mode 100644 modules/services/avahi.nix delete mode 100644 modules/services/default.nix delete mode 100644 modules/services/easyeffects.nix delete mode 100644 modules/shell/default.nix delete mode 100644 modules/shell/fish.nix delete mode 100644 modules/shell/git.nix delete mode 100644 modules/shell/zsh.nix delete mode 100644 modules/theming/cursor.nix delete mode 100644 modules/theming/default.nix delete mode 100644 modules/theming/gtk.nix delete mode 100644 modules/theming/qt.nix delete mode 100644 modules/virtualization/docker.nix delete mode 100644 modules/virtualization/qemu.nix delete mode 100644 nix/home.nix create mode 100644 nixos/configuration.nix create mode 100644 nixos/hardware-configuration.nix create mode 100644 overlays/default.nix create mode 100644 pkgs/default.nix diff --git a/flake.lock b/flake.lock index 014b280..05ed3b7 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1695108154, - "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", + "lastModified": 1685599623, + "narHash": "sha256-Tob4CMOVHue0D3RzguDBCtUmX5ji2PsdbQDbIOIKvsc=", "owner": "nix-community", "repo": "home-manager", - "rev": "07682fff75d41f18327a871088d20af2710d4744", + "rev": "93db05480c0c0f30382d3e80779e8386dcb4f9dd", "type": "github" }, "original": { @@ -21,77 +21,13 @@ "type": "github" } }, - "hyprland": { - "inputs": { - "hyprland-protocols": "hyprland-protocols", - "nixpkgs": [ - "nixpkgs-unstable" - ], - "systems": "systems", - "wlroots": "wlroots", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1697151905, - "narHash": "sha256-sfuiRn7D5D2NzDkXXN/DUUcs2d1ddlf3VmzDBzDO2Tk=", - "owner": "hyprwm", - "repo": "Hyprland", - "rev": "3a61350286de842c7f1566c38e2b42821080ddf4", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "Hyprland", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1691753796, - "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "nix-filter": { - "locked": { - "lastModified": 1693833173, - "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1696983906, - "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", + "lastModified": 1686431482, + "narHash": "sha256-oPVQ/0YP7yC2ztNsxvWLrV+f0NQ2QAwxbrZ+bgGydEM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", + "rev": "d3bb401dcfc5a46ce51cdfb5762e70cc75d082d2", "type": "github" }, "original": { @@ -103,11 +39,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1697059129, - "narHash": "sha256-9NJcFF9CEYPvHJ5ckE8kvINvI84SZZ87PvqMbH6pro0=", + "lastModified": 1686501370, + "narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5e4c2ada4fcd54b99d56d7bd62f384511a7e2593", + "rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519", "type": "github" }, "original": { @@ -117,113 +53,11 @@ "type": "github" } }, - "nur": { - "locked": { - "lastModified": 1697208312, - "narHash": "sha256-pLhWx1QA0hLBgA7KoOeYWxQYqOUYSdoTAoDEEhMGx80=", - "owner": "nix-community", - "repo": "NUR", - "rev": "90683b5b6b475583fb307cd9d557e91881dccbcd", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "root": { "inputs": { "home-manager": "home-manager", - "hyprland": "hyprland", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "nur": "nur", - "split-monitor-workspaces": "split-monitor-workspaces" - } - }, - "split-monitor-workspaces": { - "inputs": { - "hyprland": [ - "hyprland" - ], - "nix-filter": "nix-filter" - }, - "locked": { - "lastModified": 1697056199, - "narHash": "sha256-Tkd4cI4Vq6cczZjiZdfs1Q9Gke+4iL1+S3c2GAGhEvc=", - "owner": "Duckonaut", - "repo": "split-monitor-workspaces", - "rev": "9b40de35aeb8c62df3326eae7979b438f3ee0fb1", - "type": "github" - }, - "original": { - "owner": "Duckonaut", - "repo": "split-monitor-workspaces", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "wlroots": { - "flake": false, - "locked": { - "host": "gitlab.freedesktop.org", - "lastModified": 1696410538, - "narHash": "sha256-ecDhdYLXWHsxMv+EWG36mCNDvzRbu9qfjH7dLxL7aGM=", - "owner": "wlroots", - "repo": "wlroots", - "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", - "type": "gitlab" - }, - "original": { - "host": "gitlab.freedesktop.org", - "owner": "wlroots", - "repo": "wlroots", - "rev": "3406c1b17a4a7e6d4e2a7d9c1176affa72bce1bc", - "type": "gitlab" - } - }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1694628480, - "narHash": "sha256-Qg9hstRw0pvjGu5hStkr2UX1D73RYcQ9Ns/KnZMIm9w=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "8f45a6435069b9e24ebd3160eda736d7a391cbf2", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 45ec81e..61960d1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,76 +1,86 @@ -# -# flake.nix * -# ├─ ./hosts -# │ └─ default.nix -# ├─ ./darwin -# │ └─ default.nix -# └─ ./nix -# └─ default.nix -# { - description = "Nix, NixOS and Nix Darwin System Flake Configuration"; + description = "Your new nix config"; - inputs = - # References Used by Flake - { - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; # Stable Nix Packages (Default) - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable Nix Packages + inputs = { + # Nixpkgs + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + # You can access packages and modules from different nixpkgs revs + # at the same time. Here's an working example: + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. - home-manager = { - # User Environment Manager - url = "github:nix-community/home-manager/release-23.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + # Home manager + home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; - nur = { - # NUR Community Packages - url = "github:nix-community/NUR"; # Requires "nur.nixosModules.nur" to be added to the host modules - }; + # TODO: Add any other flake you might need + # hardware.url = "github:nixos/nixos-hardware"; - hyprland = { - # Official Hyprland Flake - url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules - inputs.nixpkgs.follows = "nixpkgs-unstable"; - }; + # Shameless plug: looking for a way to nixify your themes and make + # everything match nicely? Try nix-colors! + # nix-colors.url = "github:misterio77/nix-colors"; + }; - split-monitor-workspaces = { - url = "github:Duckonaut/split-monitor-workspaces"; - inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended - }; - }; - - outputs = inputs @ { + outputs = { self, nixpkgs, - nixpkgs-unstable, home-manager, - nur, - hyprland, - split-monitor-workspaces, ... - }: - # Function telling flake which inputs to use - let - vars = { - # Variables Used In Flake - user = "ghoscht"; - location = "$HOME/.setup"; - terminal = "alacritty"; - editor = "nvim"; - }; + } @ inputs: let + inherit (self) outputs; + # Supported systems for your flake packages, shell, etc. + systems = [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + # This is a function that generates an attribute by calling a function you + # pass to it, with each system as an argument + forAllSystems = nixpkgs.lib.genAttrs systems; in { - nixosConfigurations = ( # NixOS Configurations - import ./hosts { - inherit (nixpkgs) lib; - inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs - } - ); + # Your custom packages + # Accessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + # Formatter for your nix files, available through 'nix fmt' + # Other options beside 'alejandra' include 'nixpkgs-fmt' + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - homeConfigurations = ( # Nix Configurations - import ./nix/home.nix { - inherit (nixpkgs) lib; - inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces; - } - ); + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays {inherit inputs;}; + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + nixosModules = import ./modules/nixos; + # Reusable home-manager modules you might want to export + # These are usually stuff you would upstream into home-manager + homeManagerModules = import ./modules/home-manager; + + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + nixosConfigurations = { + # FIXME replace with your hostname + your-hostname = nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + modules = [ + # > Our main nixos configuration file < + ./nixos/configuration.nix + ]; + }; + }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + # FIXME replace with your username@hostname + "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = {inherit inputs outputs;}; + modules = [ + # > Our main home-manager configuration file < + ./home-manager/home.nix + ]; + }; + }; }; } diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..eedacc2 --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,69 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + # ./nvim.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + # TODO: Set your username + home = { + username = "your-username"; + homeDirectory = "/home/your-username"; + }; + + # Add stuff for your user as you see fit: + # programs.neovim.enable = true; + # home.packages = with pkgs; [ steam ]; + + # Enable home-manager and git + programs.home-manager.enable = true; + programs.git.enable = true; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "23.05"; +} diff --git a/hosts/configuration.nix b/hosts/configuration.nix deleted file mode 100644 index d23c3f5..0000000 --- a/hosts/configuration.nix +++ /dev/null @@ -1,242 +0,0 @@ -{ - config, - lib, - pkgs, - unstable, - inputs, - vars, - ... -}: { - imports = - (import ../modules/desktops) ++ (import ../modules/shell) ++ [../modules/programs/librewolf.nix ../modules/programs/alacritty.nix] ++ (import ../modules/theming) ++ (import ../modules/coding); - - users.users.${vars.user} = { - # System User - isNormalUser = true; - extraGroups = ["wheel" "video" "audio" "camera" "networkmanager" "lp" "scanner" "kvm" "libvirtd" "i2c" "tty" "dialout" "wireshark"]; - }; - - boot.supportedFilesystems = ["ntfs" "exfat"]; - - # Set default shell -> move to module - users.defaultUserShell = pkgs.fish; - environment.shells = with pkgs; [fish]; - programs.fish.enable = true; - - services.flatpak.enable = true; - # Enable the X11 windowing system. - # services.xserver.enable = true; - - # programs.ssh.startAgent = true; - - services.logind.extraConfig = '' - # don’t shutdown when power button is short-pressed - HandlePowerKey=ignore - ''; - - # Enable the KDE Plasma Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - # Configure keymap in X11 - # services.xserver = { - # layout = "de"; - # xkbVariant = ""; - # }; - - environment.defaultCursor = { - enable = true; - theme = "breeze_cursors"; - }; - - time.timeZone = "Europe/Berlin"; - i18n = { - defaultLocale = "en_US.UTF-8"; - 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 = { - # font = "Lat2-Terminus16"; - keyMap = "de"; - }; - - security = { - rtkit.enable = true; - polkit.enable = true; - }; - - fonts.fonts = with pkgs; [ - # Fonts - carlito # NixOS - vegur # NixOS - source-code-pro - jetbrains-mono - font-awesome # Icons - corefonts # MS - carlito - dejavu_fonts - ipafont - kochi-substitute - source-code-pro - ttf_bitstream_vera - inter - noto-fonts-cjk-sans - (nerdfonts.override { - # Nerdfont Icons override - fonts = [ - "JetBrainsMono" - ]; - }) - ]; - - environment = { - variables = { - # Environment Variables - TERMINAL = "${vars.terminal}"; - EDITOR = "${vars.editor}"; - VISUAL = "${vars.editor}"; - }; - systemPackages = with pkgs; - [ - # System-Wide Packages - # Terminal - btop # Resource Manager - coreutils # GNU Utilities - git # Version Control - killall # Process Killer - nano # Text Editor - neovim - nix-tree # Browse Nix Store - pciutils # Manage PCI - tldr # Helper - usbutils # Manage USB - wget # Retriever - bat - lazygit - fzf - neofetch - jmtpfs # Android MTP - ipinfo - - # Video/Audio - alsa-utils # Audio Control - feh # Image Viewer - mpv # Media Player - pavucontrol # Audio Control - pipewire # Audio Server/Control - pulseaudio # Audio Server/Control - jellyfin-media-player - - # Apps - appimage-run # Runs AppImages on NixOS - webcord - signal-desktop - alacritty - librewolf - zathura - - # File Management - unzip # Zip Files - unrar # Rar Files - zip # Zip - - # Shell - fishPlugins.grc - grc - fishPlugins.fzf - fishPlugins.tide - fishPlugins.sponge - fishPlugins.colored-man-pages - fishPlugins.autopair - nix-your-shell - # Other Packages Found @ - # - .//default.nix - # - ../modules - ] - ++ (with unstable; [ - # Terminal - eza - - # Apps - feishin - sddm - electron-mail - xournalpp - ]); - }; - - programs = { - dconf.enable = true; - }; - - i18n.inputMethod = { - enabled = "fcitx5"; - fcitx5.addons = with pkgs; [ - fcitx5-mozc - fcitx5-gtk - ]; - }; - - services = { - printing = { - # CUPS - enable = true; - }; - pipewire = { - # Sound - enable = true; - alsa = { - enable = true; - support32Bit = true; - }; - pulse.enable = true; - jack.enable = true; - }; - }; - - #hardware.pulseaudio.enable = false; - - nix = { - # Nix Package Manager Settings - settings = { - auto-optimise-store = true; - }; - # gc = { # Garbage Collection - # automatic = true; - # dates = "weekly"; - # options = "--delete-older-than 2d"; - # }; - package = pkgs.nixVersions.unstable; # Enable Flakes - registry.nixpkgs.flake = inputs.nixpkgs; - extraOptions = '' - experimental-features = nix-command flakes - keep-outputs = true - keep-derivations = true - ''; - }; - nixpkgs.config.allowUnfree = true; # Allow Proprietary Software. - - system = { - # NixOS Settings - stateVersion = "23.05"; - }; - - home-manager.users.${vars.user} = { - # Home-Manager Settings - home = { - stateVersion = "23.05"; - }; - - programs = { - home-manager.enable = true; - }; - }; -} diff --git a/hosts/convertible/default.nix b/hosts/convertible/default.nix deleted file mode 100644 index 5bfae33..0000000 --- a/hosts/convertible/default.nix +++ /dev/null @@ -1,82 +0,0 @@ -# NOTE: Dual booted with windows 11. Disable fast-boot in power plan and bios and turn off hibernate to get wifi and bluetooth working. This only works once but on reboot is borked again. So using the old school BLT dongle. -# -{ - lib, - pkgs, - vars, - unstable, - ... -}: { - imports = [ - ./hardware-configuration.nix - ../../modules/virtualization/docker.nix - ../../modules/virtualization/qemu.nix - ../../modules/secrets/gnome-keyring.nix - ../../modules/secrets/gpg.nix - ]; - - boot = { - # Boot Options - loader = { - systemd-boot = { - enable = true; - configurationLimit = 3; - }; - efi = { - canTouchEfiVariables = true; - }; - timeout = 5; - }; - }; - - boot.initrd.secrets = { - "/crypto_keyfile.bin" = null; - }; - - # Enable swap on luks - boot.initrd.luks.devices."luks-4397a73c-b1b9-4fd0-8f7d-21d5159269b8".device = "/dev/disk/by-uuid/4397a73c-b1b9-4fd0-8f7d-21d5159269b8"; - boot.initrd.luks.devices."luks-4397a73c-b1b9-4fd0-8f7d-21d5159269b8".keyFile = "/crypto_keyfile.bin"; - - boot.kernelParams = ["i915.force_probe=9a49"]; - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # LIBVA_DRIVER_NAME=iHD - vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) - vaapiVdpau - libvdpau-va-gl - ]; - }; - # i18n.inputmethod = { - # enabled = "fcitx5"; - # # fcitx5.addons = with pkgs; [ - # # fcitx5-mozc - # # fcitx5-gtk - # # ]; - # }; - - gnome.enable = true; - awesome.enable = true; - - services.tailscale.enable = true; - services.tailscale.useRoutingFeatures = "client"; - - environment = { - etc = { - "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' - bluez_monitor.properties = { - ["bluez5.enable-hw-volume"] = false, - } - ''; - }; - systemPackages = with pkgs; - [ - tailscale - nextcloud-client - calibre - libreoffice - element-desktop - ] - ++ (with unstable; [xournalpp]); - }; -} diff --git a/hosts/convertible/hardware-configuration.nix b/hosts/convertible/hardware-configuration.nix deleted file mode 100644 index d4f0e34..0000000 --- a/hosts/convertible/hardware-configuration.nix +++ /dev/null @@ -1,46 +0,0 @@ -# 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 + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "vmd" "nvme" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/e36453a3-629d-4704-a42e-180bf3640722"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-5f04c1e9-c3fe-42fb-97d1-0833bf66435a".device = "/dev/disk/by-uuid/5f04c1e9-c3fe-42fb-97d1-0833bf66435a"; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/A2B4-1BBE"; - fsType = "vfat"; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/b16f0d66-5aec-4e0e-8162-c8e87e19888c";} - ]; - - # 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"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/default.nix b/hosts/default.nix deleted file mode 100644 index 594315a..0000000 --- a/hosts/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - lib, - inputs, - nixpkgs, - nixpkgs-unstable, - home-manager, - nur, - hyprland, - split-monitor-workspaces, - vars, - ... -}: let - system = "x86_64-linux"; # System Architecture - - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; # Allow Proprietary Software - }; - - unstable = import nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - }; - - lib = nixpkgs.lib; -in { - desktop = lib.nixosSystem { - # Desktop Profile - inherit system; - specialArgs = { - # Pass Flake Variable - inherit inputs system unstable hyprland vars split-monitor-workspaces; - host = { - hostName = "desktop"; - mainMonitor = "DP-3"; - secondMonitor = "DP-1"; - }; - }; - modules = [ - # Modules Used - nur.nixosModules.nur - hyprland.nixosModules.default - ./desktop - ./configuration.nix - home-manager.nixosModules.home-manager - { - # Home-Manager Module - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - }; - convertible = lib.nixosSystem { - # Desktop Profile - inherit system; - specialArgs = { - # Pass Flake Variable - inherit inputs system unstable hyprland vars split-monitor-workspaces; - host = { - hostName = "convertible"; - mainMonitor = "DP-3"; - secondMonitor = "DP-1"; - }; - }; - modules = [ - # Modules Used - nur.nixosModules.nur - hyprland.nixosModules.default - ./convertible - ./configuration.nix - home-manager.nixosModules.home-manager - { - # Home-Manager Module - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } - ]; - }; -} diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix deleted file mode 100644 index 9c6625a..0000000 --- a/hosts/desktop/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -# NOTE: Dual booted with windows 11. Disable fast-boot in power plan and bios and turn off hibernate to get wifi and bluetooth working. This only works once but on reboot is borked again. So using the old school BLT dongle. -# -{ - lib, - pkgs, - vars, - unstable, - ... -}: { - imports = [ - ./hardware-configuration.nix - ../../modules/hardware/nvidia.nix - ../../modules/services/avahi.nix - ../../modules/virtualization/docker.nix - ../../modules/virtualization/qemu.nix - ../../modules/programs/games.nix - ../../modules/secrets/gnome-keyring.nix - ../../modules/secrets/gpg.nix - # ../../modules/services/easyeffects.nix - ]; - - boot = { - # Boot Options - loader = { - systemd-boot = { - enable = true; - configurationLimit = 3; - }; - efi = { - canTouchEfiVariables = true; - }; - timeout = 5; - }; - kernelPackages = unstable.linuxPackages_latest; - }; - - hardware = { - sane = { - # Scanning - enable = true; - extraBackends = [unstable.utsushi]; - }; - }; - services.udev.packages = [unstable.utsushi]; - - # Desktops - hyprland.enable = false; - kde.enable = false; - awesome.enable = true; - - programs.kdeconnect.enable = true; - environment = { - systemPackages = with pkgs; - [ - # System-Wide Packages - discord # Messaging - obs-studio # Live Streaming - simple-scan # Scanning - firefox - heroic - nextcloud-client - anki - easyeffects - qpwgraph - calibre - ] - ++ (with unstable; [ - libsForQt5.kdeconnect-kde - ]); - }; -} diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix deleted file mode 100644 index ab97b97..0000000 --- a/hosts/desktop/hardware-configuration.nix +++ /dev/null @@ -1,43 +0,0 @@ -# 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 + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/f9ba57fb-0b82-47e0-8189-7bbebc530e2b"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/BCF2-51D4"; - fsType = "vfat"; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/4834fbc3-3feb-4b93-b11f-8b9bd054c5c1";} - ]; - - # 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.enp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/modules/coding/android-studio.nix b/modules/coding/android-studio.nix deleted file mode 100644 index e3e9227..0000000 --- a/modules/coding/android-studio.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - config, - lib, - pkgs, - unstable, - vars, - ... -}: let -in { - home-manager.users.${vars.user} = { - }; - - programs.adb.enable = true; - users.users.${vars.user}.extraGroups = ["adbusers"]; - - environment.systemPackages = with unstable; [ - android-studio - ]; -} diff --git a/modules/coding/default.nix b/modules/coding/default.nix deleted file mode 100644 index e68a1d3..0000000 --- a/modules/coding/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -[ - ./nvim.nix - ./vscode.nix - ./intellij.nix - ./android-studio.nix -] diff --git a/modules/coding/intellij.nix b/modules/coding/intellij.nix deleted file mode 100644 index eff3cec..0000000 --- a/modules/coding/intellij.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - config, - lib, - pkgs, - unstable, - vars, - ... -}: let -in { - home-manager.users.${vars.user} = { - }; - - environment.systemPackages = with unstable; [ - (jetbrains.plugins.addPlugins jetbrains.idea-ultimate ["ideavim"]) - ]; -} diff --git a/modules/coding/nvim.nix b/modules/coding/nvim.nix deleted file mode 100644 index 657abdc..0000000 --- a/modules/coding/nvim.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: let -in { - home-manager.users.${vars.user} = { - home.file.".config/nvim/lua/custom/" = { - source = ../../rsc/config/nvim; - recursive = true; - }; - }; - - environment.systemPackages = with pkgs; [ - gcc - black - python310Packages.debugpy # is this working? - mypy - ruff - nodePackages.pyright - clang-tools_16 - rnix-lsp - rust-analyzer - nodePackages.eslint_d - nodePackages.jsonlint - alejandra - ]; -} diff --git a/modules/coding/vscode.nix b/modules/coding/vscode.nix deleted file mode 100644 index 8a33c9d..0000000 --- a/modules/coding/vscode.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: let -in { - home-manager.users.${vars.user} = { - programs.vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; - [ - catppuccin.catppuccin-vsc - pkief.material-icon-theme - vscodevim.vim - bbenoist.nix - ms-python.python - ms-toolsai.jupyter - ms-toolsai.jupyter-renderers - ms-toolsai.jupyter-keymap - ] - ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - { - name = "remote-ssh-edit"; - publisher = "ms-vscode-remote"; - version = "0.47.2"; - sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; - } - { - name = "cpptools"; - publisher = "ms-vscode"; - version = "1.19.1"; - sha256 = "sha256-yUZTLnN4nomFp5I0VgRz7rRMkeMU9QzY+dzEdUUASek="; - } - { - name = "camkes-syntax-highlighting"; - publisher = "hensoldt-cyber-gmbh"; - version = "1.1.3"; - sha256 = "sha256-dRhsFGSjR/Vp5aJgMDwCZQtwmmfNXbM85ViTIq5ORwY="; - } - ]; - userSettings = { - #Theming - "workbench.colorTheme" = "Catppuccin Mocha"; - "catppuccin.accentColor" = "teal"; - "workbench.iconTheme" = "material-icon-theme"; - "window.menuBarVisibility" = "toggle"; - "editor.minimap.autohide" = false; - #Extensions - General - "extensions.autoCheckUpdates" = false; - "extensions.autoUpdate" = false; - # Startup - "workbench.startupEditor" = "none"; - # Vim - "editor.lineNumbers" = "relative"; - }; - keybindings = [ - # Navigating Autosuggest and Quick Open entries - { - "key" = "ctrl+j"; - "command" = "selectNextSuggestion"; - "when" = "suggestWidgetVisible"; - } - { - "key" = "ctrl+k"; - "command" = "selectPrevSuggestion"; - "when" = "suggestWidgetVisible"; - } - { - "key" = "ctrl+j"; - "command" = "workbench.action.quickOpenSelectNext"; - "when" = "inQuickOpen"; - } - { - "key" = "ctrl+k"; - "command" = "workbench.action.quickOpenSelectPrevious"; - "when" = "inQuickOpen"; - } - ]; - }; - }; - - # programs.vscode.package = pkgs.vscodium.fhsWithPackages (ps: with ps; [rustup zlib]); -} diff --git a/modules/desktops/awesome.nix b/modules/desktops/awesome.nix deleted file mode 100644 index 655c474..0000000 --- a/modules/desktops/awesome.nix +++ /dev/null @@ -1,82 +0,0 @@ -# -# AwesomeWM Configuration -# Enable with "awesome.enable = true;" -# -{ - config, - lib, - pkgs, - vars, - ... -}: -with lib; { - options = { - awesome = { - enable = mkOption { - type = types.bool; - default = false; - }; - }; - }; - - config = mkIf (config.awesome.enable) { - services = { - xserver = { - enable = true; - layout = "de"; - # dpi = 180; - libinput.enable = true; - modules = [pkgs.xf86_input_wacom]; - wacom.enable = true; - windowManager.awesome.enable = true; - }; - }; - - home-manager.users.${vars.user} = { - home.file.".wallpapers" = { - source = ../../rsc/wallpaper; - recursive = true; - }; - home.file.".config/awesome/" = { - source = ../../rsc/config/awesome; - recursive = true; - }; - home.file.".config/picom/" = { - source = ../../rsc/config/picom; - recursive = true; - }; - home.file.".config/rofi" = { - source = ../../rsc/config/rofi; - recursive = true; - }; - home.file.".config/flameshot" = { - source = ../../rsc/config/flameshot; - recursive = true; - }; - home.file.".config/zathura" = { - source = ../../rsc/config/zathura; - recursive = true; - }; - }; - environment = { - systemPackages = with pkgs; - [ - picom - rofi - redshift - xbindkeys - clipmenu - flameshot - xclip - brightnessctl - ] - ++ (with unstable; []); - }; - # Flatpak - xdg.portal.enable = true; - xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-kde]; - - # Networking - networking.networkmanager.enable = true; - }; -} diff --git a/modules/desktops/default.nix b/modules/desktops/default.nix deleted file mode 100644 index 7b2a303..0000000 --- a/modules/desktops/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -[ - ./hyprland.nix - ./kde.nix - ./gnome.nix - ./awesome.nix -] diff --git a/modules/desktops/gnome.nix b/modules/desktops/gnome.nix deleted file mode 100644 index 8395c6d..0000000 --- a/modules/desktops/gnome.nix +++ /dev/null @@ -1,66 +0,0 @@ -# -# Gnome Configuration -# Enable with "gnome.enable = true;" -# -{ - config, - lib, - pkgs, - vars, - ... -}: -with lib; { - options = { - gnome = { - enable = mkOption { - type = types.bool; - default = false; - }; - }; - }; - - config = mkIf (config.gnome.enable) { - hardware.pulseaudio.enable = false; - services = { - xserver = { - enable = true; - - layout = "de"; - libinput.enable = true; - modules = [pkgs.xf86_input_wacom]; - wacom.enable = true; - - desktopManager.gnome.enable = true; # Desktop Environment - }; - udev.packages = with pkgs; [ - gnome.gnome-settings-daemon - ]; - }; - - environment = { - systemPackages = with pkgs; [ - # System-Wide Packages - gnome.adwaita-icon-theme - gnome.dconf-editor - gnome.gnome-tweaks - ]; - gnome.excludePackages = - (with pkgs; [ - # Ignored Packages - gnome-tour - ]) - ++ (with pkgs.gnome; [ - atomix - epiphany - geary - gedit - gnome-characters - gnome-contacts - gnome-initial-setup - hitori - iagno - tali - ]); - }; - }; -} diff --git a/modules/desktops/hyprland.nix b/modules/desktops/hyprland.nix deleted file mode 100644 index 87358eb..0000000 --- a/modules/desktops/hyprland.nix +++ /dev/null @@ -1,289 +0,0 @@ -# -# Hyprland Configuration -# Enable with "hyprland.enable = true;" -# -{ - config, - lib, - system, - pkgs, - unstable, - hyprland, - vars, - host, - split-monitor-workspaces, - ... -}: let - hyprlandconf = '' - monitor = DP-1,1920x1080@75,auto,auto - monitor = DP-3,2560x1440@144,auto,auto - monitor = ,preferred,auto,auto - - source = ~/.config/hypr/mocha.conf - - exec-once = waybar - exec-once = dunst - exec-once = swww init && swww img ~/.wallpapers/robot.jpg - exec-once = signal-desktop --start-in-tray - exec-once = webcord --start-minimized - - env = XCURSOR_SIZE,24 - env = LIBVA_DRIVER_NAME,nvidia - env = XDG_SESSION_TYPE,wayland - env = GBM_BACKEND,nvidia-drm - env = __GLX_VENDOR_LIBRARY_NAME,nvidia - env = WLR_NO_HARDWARE_CURSORS,1 - env = NIXOS_OZONE_WL,1 # for any ozone-based browser & electron apps to run on wayland - env = MOZ_ENABLE_WAYLAND,1 # for firefox to run on wayland - env = MOZ_WEBRENDER,1 - - plugin { - split-monitor-workspaces { - count = 9 - } - } - - input { - kb_layout = de - kb_variant = - kb_model = - kb_options = - kb_rules = - - follow_mouse = 1 - - touchpad { - natural_scroll = no - } - - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. - } - - general { - gaps_in = 5 - gaps_out = 5 - border_size = 2 - col.active_border = $teal - col.inactive_border = $tealAlpha - - layout = dwindle - } - - misc { - disable_hyprland_logo = true - vrr = true - vfr = true - } - - decoration { - screen_shader = ~/.config/hypr/shaders/nightlight.frag - - rounding = 10 - - blur { - enabled = true - size = 3 - passes = 1 - } - - drop_shadow = yes - shadow_range = 4 - shadow_render_power = 3 - col.shadow = rgba(1a1a1aee) - } - - animations { - enabled = yes - - bezier = myBezier, 0.05, 0.9, 0.1, 1.05 - - animation = windows, 1, 7, myBezier - animation = windowsOut, 1, 7, default, popin 80% - animation = border, 1, 10, default - animation = borderangle, 1, 8, default - animation = fade, 1, 7, default - animation = workspaces, 1, 6, default - } - - dwindle { - pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below - preserve_split = yes # you probably want this - } - - master { - new_is_master = true - } - - gestures { - workspace_swipe = off - } - - $mainMod = SUPER - - bind = $mainMod, RETURN, exec, alacritty - bind = $mainMod, SPACE, exec, rofi -i -show drun -modi drun -show-icons - bind = SUPER_SHIFT, C, killactive, - bind = SUPER_SHIFT, Q, exit, - bind = $mainMod, V, togglefloating, - bind = $mainMod, P, pseudo, # dwindle - bind = $mainMod, J, togglesplit, # dwindle - bind = $mainMod, O, split-changemonitorsilent,next - # Move focus with mainMod + arrow keys - bind = $mainMod, left, movefocus, l - bind = $mainMod, right, movefocus, r - bind = $mainMod, up, movefocus, u - bind = $mainMod, down, movefocus, d - - # Switch workspaces with mainMod + [0-9] - bind = $mainMod, 1, split-workspace, 1 - bind = $mainMod, 2, split-workspace, 2 - bind = $mainMod, 3, split-workspace, 3 - bind = $mainMod, 4, split-workspace, 4 - bind = $mainMod, 5, split-workspace, 5 - bind = $mainMod, 6, split-workspace, 6 - bind = $mainMod, 7, split-workspace, 7 - bind = $mainMod, 8, split-workspace, 8 - bind = $mainMod, 9, split-workspace, 9 - bind = $mainMod, 0, split-workspace, 10 - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - bind = $mainMod SHIFT, 1, split-movetoworkspace, 1 - bind = $mainMod SHIFT, 2, split-movetoworkspace, 2 - bind = $mainMod SHIFT, 3, split-movetoworkspace, 3 - bind = $mainMod SHIFT, 4, split-movetoworkspace, 4 - bind = $mainMod SHIFT, 5, split-movetoworkspace, 5 - bind = $mainMod SHIFT, 6, split-movetoworkspace, 6 - bind = $mainMod SHIFT, 7, split-movetoworkspace, 7 - bind = $mainMod SHIFT, 8, split-movetoworkspace, 8 - bind = $mainMod SHIFT, 9, split-movetoworkspace, 9 - bind = $mainMod SHIFT, 0, split-movetoworkspace, 10 - - # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = $mainMod, mouse:272, movewindow - bindm = $mainMod, mouse:273, resizewindow - - bind = SUPERSHIFT, V, exec, cliphist list | rofi -dmenu | cliphist decode | wl-copy - bind = $mainMod, L, exec, librewolf - bind = $mainMod SHIFT, L, exec, librewolf --private-window - ''; -in - with lib; - with host; { - options = { - hyprland = { - enable = mkOption { - type = types.bool; - default = false; - }; - }; - }; - - config = mkIf (config.hyprland.enable) { - environment = { - systemPackages = with pkgs; - [ - grim # Grab Images - slurp # Region Selector - wl-clipboard # Clipboard - wlr-randr # Monitor Settings - dunst - cliphist - rofi-wayland - swww - ] - ++ (with unstable; [waybar]); - # sessionVariables = { - # "NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland - # "MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland - # "MOZ_WEBRENDER" = "1"; - # - # # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/ - # "LIBVA_DRIVER_NAME" = "nvidia"; - # "XDG_SESSION_TYPE" = "wayland"; - # "GBM_BACKEND" = "nvidia-drm"; - # "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; - # "WLR_NO_HARDWARE_CURSORS" = "1"; - # "WLR_EGL_NO_MODIFIRES" = "1"; - # }; - }; - - programs = { - hyprland = { - # Window Manager - enable = true; - xwayland.enable = true; - enableNvidiaPatches = - if hostName == "desktop" - then true - else false; - }; - }; - - hardware = { - opengl = { - enable = true; - }; - }; - - xdg.portal = { - enable = true; - extraPortals = with pkgs; [xdg-desktop-portal-gtk]; - }; - - home-manager.users.${vars.user} = { - imports = [hyprland.homeManagerModules.default]; - - home.file.".config/hypr/" = { - source = ../../rsc/config/hypr; - recursive = true; - }; - - home.file.".config/waybar" = { - source = ../../rsc/config/waybar; - recursive = true; - }; - - home.file.".config/dunst" = { - source = ../../rsc/config/dunst; - recursive = true; - }; - - home.file.".config/rofi" = { - source = ../../rsc/config/rofi; - recursive = true; - }; - - home.file.".wallpapers" = { - source = ../../rsc/wallpaper; - recursive = true; - }; - - programs.waybar.package = pkgs.waybar.overrideAttrs (oa: { - mesonFlags = (oa.mesonFlags or []) ++ ["-Dexperimental=true"]; - patches = - (oa.patches or []) - ++ [ - (pkgs.fetchpatch { - name = "fix waybar hyprctl"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/hyprctl.patch?h=waybar-hyprland-git"; - sha256 = "sha256-pY3+9Dhi61Jo2cPnBdmn3NUTSA8bAbtgsk2ooj4y7aQ="; - }) - ]; - }); - - wayland.windowManager.hyprland = { - enable = true; - systemdIntegration = true; - extraConfig = hyprlandconf; - plugins = [ - split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces - ]; - }; - }; - - nix.settings = { - substituters = ["https://hyprland.cachix.org"]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; - }; # Cache - }; - } diff --git a/modules/desktops/kde.nix b/modules/desktops/kde.nix deleted file mode 100644 index c16e955..0000000 --- a/modules/desktops/kde.nix +++ /dev/null @@ -1,52 +0,0 @@ -# -# KDE Plasma 5 Configuration -# Enable with "kde.enable = true;" -# -{ - config, - lib, - pkgs, - vars, - ... -}: -with lib; { - options = { - kde = { - enable = mkOption { - type = types.bool; - default = false; - }; - }; - }; - - config = mkIf (config.kde.enable) { - services = { - xserver = { - enable = true; - - layout = "de"; - libinput.enable = true; - modules = [pkgs.xf86_input_wacom]; - wacom.enable = true; - - #displayManager.defaultSession = "plasmawayland"; - - desktopManager.plasma5 = { - enable = true; # Desktop Environment - }; - }; - }; - - environment = { - systemPackages = with pkgs.libsForQt5; [ - # System-Wide Packages - ]; - plasma5.excludePackages = with pkgs.libsForQt5; [ - elisa - khelpcenter - konsole - oxygen - ]; - }; - }; -} diff --git a/modules/hardware/nvidia.nix b/modules/hardware/nvidia.nix deleted file mode 100644 index 3e13867..0000000 --- a/modules/hardware/nvidia.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services.xserver.videoDrivers = ["nvidia"]; - hardware = { - opengl.enable = true; - nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.stable; - modesetting.enable = true; - powerManagement.enable = false; - open = true; - nvidiaSettings = true; - }; - }; -} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..45aae31 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,6 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..8605069 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,6 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix deleted file mode 100644 index fc3dce3..0000000 --- a/modules/programs/alacritty.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - home.file.".config/alacritty" = { - source = ../../rsc/config/alacritty; - recursive = true; - }; - }; -} diff --git a/modules/programs/games.nix b/modules/programs/games.nix deleted file mode 100644 index 8854d12..0000000 --- a/modules/programs/games.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - pkgs, - nur, - lib, - unstable, - ... -}: { - environment.systemPackages = [ - unstable.heroic # Game Launcher - unstable.lutris # Game Launcher - unstable.steam # Game Launcher - ]; - - programs = { - steam = { - enable = true; - }; - gamemode.enable = true; # Better Gaming Performance - # Steam: Right-click game - Properties - Launch options: gamemoderun %command% - # Lutris: General Preferences - Enable Feral GameMode - # - Global options - Add Environment Variables: LD_PRELOAD=/nix/store/*-gamemode-*-lib/lib/libgamemodeauto.so - }; -} diff --git a/modules/programs/librewolf.nix b/modules/programs/librewolf.nix deleted file mode 100644 index f89161d..0000000 --- a/modules/programs/librewolf.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - nixpkgs.config.librewolf.enablePlasmaBrowserIntegration = true; - - home-manager.users.${vars.user} = { - programs.librewolf = { - enable = true; - settings = { - "identity.fxaccounts.enabled" = true; - "browser.sessionstore.enabled" = false; - "browser.startup.page" = 1; - "browser.sessionstore.resume_session_once" = true; - "browser.sessionstore.resume_from_crash" = false; - "middlemouse.paste" = false; - "general.autoScroll" = true; - "security.OCSP.require" = false; - }; - }; - }; -} diff --git a/modules/secrets/gnome-keyring.nix b/modules/secrets/gnome-keyring.nix deleted file mode 100644 index 701b31f..0000000 --- a/modules/secrets/gnome-keyring.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - security.pam.services.${vars.user}.enableGnomeKeyring = true; - services.gnome.gnome-keyring.enable = true; - programs.seahorse.enable = true; -} diff --git a/modules/secrets/gpg.nix b/modules/secrets/gpg.nix deleted file mode 100644 index 4bf05a4..0000000 --- a/modules/secrets/gpg.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - programs.gpg = { - enable = true; - }; - services.gpg-agent = { - enable = true; - enableSshSupport = true; - enableFishIntegration = true; - enableZshIntegration = true; - pinentryFlavor = "gnome3"; - }; - - # Prevent clobbering SSH_AUTH_SOCK - home.sessionVariables.GSM_SKIP_SSH_AGENT_WORKAROUND = "1"; - - # Disable gnome-keyring ssh-agent - xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = '' - ${lib.fileContents "${pkgs.gnome3.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop"} - Hidden=true - ''; - }; - -} diff --git a/modules/services/avahi.nix b/modules/services/avahi.nix deleted file mode 100644 index 57f7f3a..0000000 --- a/modules/services/avahi.nix +++ /dev/null @@ -1,16 +0,0 @@ -# -# Network Discoverability (for printers, scanners and such) -# -{ - services = { - avahi = { - enable = true; - nssmdns = true; - publish = { - enable = true; - addresses = true; - userServices = true; - }; - }; - }; -} diff --git a/modules/services/default.nix b/modules/services/default.nix deleted file mode 100644 index 79210c6..0000000 --- a/modules/services/default.nix +++ /dev/null @@ -1 +0,0 @@ -[./avahi.nix] diff --git a/modules/services/easyeffects.nix b/modules/services/easyeffects.nix deleted file mode 100644 index 8d0149b..0000000 --- a/modules/services/easyeffects.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - services.easyeffects.enable = true; - - home.file.".config/easyeffects/output/Beyerdynamic_DT990_Oratory.json" = { - source = ../../rsc/config/easyeffects/Beyerdynamic_DT990_Oratory.json; - }; - }; -} diff --git a/modules/shell/default.nix b/modules/shell/default.nix deleted file mode 100644 index 717f050..0000000 --- a/modules/shell/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -[ - ./git.nix - ./fish.nix - ./zsh.nix -] diff --git a/modules/shell/fish.nix b/modules/shell/fish.nix deleted file mode 100644 index 39cb56f..0000000 --- a/modules/shell/fish.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - programs.fish = { - enable = true; - interactiveShellInit = '' - nix-your-shell fish | source - set fish_greeting - ''; - shellAliases = { - lzg = "lazygit"; - lzd = "lazydocker"; - batt = ''upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -e "percentage" -e "state"''; - hx = "~/Documents/heliox-cli/target/debug/heliox-cli --mode"; - slp = "systemctl suspend"; - sdn = "shutdown 0"; - }; - shellAbbrs = { - build = "bash sdk/scripts/open_trentos_build_env.sh sdk/build-system.sh sdk/demos/demo_hello_world rpi3 build-rpi3-Debug-demo_hello_world -DCMAKE_BUILD_TYPE=Debug"; - simbuild = "bash sdk/scripts/open_trentos_build_env.sh sdk/build-system.sh sdk/demos/demo_hello_world zynq7000 build-zynq7000-Debug-demo_hello_world -DCMAKE_BUILD_TYPE=Debug"; - sim = "sudo bash ../sdk/scripts/open_trentos_test_env.sh ./simulate"; - }; - }; - }; -} diff --git a/modules/shell/git.nix b/modules/shell/git.nix deleted file mode 100644 index 4d19487..0000000 --- a/modules/shell/git.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - #Prefer IPv4 for ssh - home.file.".ssh/config".text = "AddressFamily inet"; - - programs.git = { - enable = true; - userName = "GHOSCHT"; - userEmail = "31184695+GHOSCHT@users.noreply.github.com"; - - extraConfig = { - commit.gpgsign = true; - user.signingkey = "0x2C2C1C62A5388E82"; - init.defaultBranch = "main"; - }; - }; - }; -} diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix deleted file mode 100644 index 1cb175b..0000000 --- a/modules/shell/zsh.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - home.file."~/.config/zsh/.p10k.zsh" = { - source = ../../rsc/config/zsh/.p10k.zsh; - }; - - programs.zsh = { - enable = true; - autocd = true; - dotDir = ".config/zsh"; - enableAutosuggestions = true; - enableCompletion = true; - shellAliases = { - sl = "eza"; - ls = "eza"; - l = "eza -l"; - la = "eza -la"; - ip = "ip --color=auto"; - }; - - initExtra = '' - [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh - nix-your-shell zsh | source /dev/stdin - ''; - - zplug = { - enable = true; - plugins = [ - { - name = "romkatv/powerlevel10k"; - tags = ["as:theme" "depth:1"]; - } - ]; - }; - - plugins = [ - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = pkgs.fetchFromGitHub { - owner = "chisui"; - repo = "zsh-nix-shell"; - rev = "v0.7.0"; - sha256 = "149zh2rm59blr2q458a5irkfh82y3dwdich60s9670kl3cl5h2m1"; - }; - } - ]; - }; - programs.fzf = { - enable = true; - enableZshIntegration = true; - }; - }; -} diff --git a/modules/theming/cursor.nix b/modules/theming/cursor.nix deleted file mode 100644 index 45753b9..0000000 --- a/modules/theming/cursor.nix +++ /dev/null @@ -1,44 +0,0 @@ -# Module to set a default cursor theme -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.environment.defaultCursor; - - indexThemeText = theme: generators.toINI {} {"icon theme" = {Inherits = "${theme}";};}; - - mkDefaultCursorFile = theme: - pkgs.writeTextDir - "share/icons/default/index.theme" - "${indexThemeText theme}"; - - defaultCursorPkg = mkDefaultCursorFile cfg.theme; -in { - options = { - environment.defaultCursor = { - enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to set a default cursor theme for graphical environments. - ''; - }; - - theme = mkOption { - type = types.str; - default = ""; - example = "Adwaita"; - description = "The name of the defualt cursor theme."; - }; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ - defaultCursorPkg - ]; - }; -} diff --git a/modules/theming/default.nix b/modules/theming/default.nix deleted file mode 100644 index 4d9a7d0..0000000 --- a/modules/theming/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -[ - # ./gtk.nix - # ./qt.nix - ./cursor.nix -] diff --git a/modules/theming/gtk.nix b/modules/theming/gtk.nix deleted file mode 100644 index 5c1af22..0000000 --- a/modules/theming/gtk.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - home-manager.users.${vars.user} = { - gtk.enable = true; - - # gtk.cursorTheme.package = pkgs.bibata-cursors; - # gtk.cursorTheme.name = "Bibata-Modern-Ice"; - - gtk.theme.package = pkgs.adw-gtk3; - gtk.theme.name = "adw-gtk3"; - - # gtk.iconTheme.package = gruvboxPlus; - # gtk.iconTheme.name = "GruvboxPlus"; - }; -} diff --git a/modules/theming/qt.nix b/modules/theming/qt.nix deleted file mode 100644 index 96e1510..0000000 --- a/modules/theming/qt.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - lib, - pkgs, - vars, - ... -}: { - environment.systemPackages = with pkgs; [ - libsForQt5.qtstyleplugins - libsForQt5.qtstyleplugin-kvantum - #other stuff - ]; - home-manager.users.${vars.user} = { - qt.enable = true; - - # platform theme "gtk" or "gnome" - qt.platformTheme = "gtk"; - - # name of the qt theme - qt.style.name = "adwaita"; - - # detected automatically: - # adwaita, adwaita-dark, adwaita-highcontrast, - # adwaita-highcontrastinverse, breeze, - # bb10bright, bb10dark, cde, cleanlooks, - # gtk2, motif, plastique - - # package to use - qt.style.package = pkgs.adwaita-qt; - }; -} diff --git a/modules/virtualization/docker.nix b/modules/virtualization/docker.nix deleted file mode 100644 index 3e010c4..0000000 --- a/modules/virtualization/docker.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - config, - pkgs, - vars, - ... -}: { - virtualisation = { - docker.enable = true; - }; - - users.groups.docker.members = ["${vars.user}"]; - - environment.systemPackages = with pkgs; [ - docker # Containers - docker-compose # Multi-Container - lazydocker - ]; -} diff --git a/modules/virtualization/qemu.nix b/modules/virtualization/qemu.nix deleted file mode 100644 index 9ec2e53..0000000 --- a/modules/virtualization/qemu.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - config, - pkgs, - vars, - ... -}: { - boot.extraModprobeConfig = '' - options kvm_intel nested=1 - ''; - - users.groups.libvirtd.members = ["root" "${vars.user}"]; - - virtualisation = { - libvirtd = { - enable = true; - qemu = { - verbatimConfig = '' - nvram = [ "${pkgs.OVMF}/FV/OVMF.fd:${pkgs.OVMF}/FV/OVMF_VARS.fd" ] - ''; - swtpm.enable = true; - }; - }; - spiceUSBRedirection.enable = true; - }; - - environment = { - systemPackages = with pkgs; [ - virt-manager # VM Interface - virt-viewer # Remote VM - qemu # Virtualizer - OVMF # UEFI Firmware - gvfs # Shared Directory - swtpm # TPM - virglrenderer # Virtual OpenGL - ]; - }; - - services = { - # File Sharing - gvfs.enable = true; - }; -} diff --git a/nix/home.nix b/nix/home.nix deleted file mode 100644 index 3f49236..0000000 --- a/nix/home.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - lib, - inputs, - nixpkgs, - home-manager, - hyprland, - split-monitor-workspaces, - vars, - ... -}: let - system = "x86_64-linux"; # System Architecture - pkgs = nixpkgs.legacyPackages.${system}; -in { - pacman = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = {inherit inputs vars hyprland;}; - modules = [ - # Modules Used - { - home = { - username = "${vars.user}"; - homeDirectory = "/home/${vars.user}"; - packages = [pkgs.home-manager]; - stateVersion = "23.05"; - }; - } - ]; - }; -} diff --git a/nixos/configuration.nix b/nixos/configuration.nix new file mode 100644 index 0000000..c8b7600 --- /dev/null +++ b/nixos/configuration.nix @@ -0,0 +1,113 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = ["/etc/nix/path"]; + environment.etc = + lib.mapAttrs' + (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) + config.nix.registry; + + nix.settings = { + # Enable flakes and new 'nix' command + experimental-features = "nix-command flakes"; + # Deduplicate and optimize nix store + auto-optimise-store = true; + }; + + # FIXME: Add the rest of your current configuration + + # TODO: Set your hostname + networking.hostName = "your-hostname"; + + # TODO: This is just an example, be sure to use whatever bootloader you prefer + boot.loader.systemd-boot.enable = true; + + # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. + users.users = { + # FIXME: Replace with your username + your-username = { + # TODO: You can set an initial password for your user. + # If you do, you can skip setting a root password by passing '--no-root-passwd' to nixos-install. + # Be sure to change it (using passwd) after rebooting! + initialPassword = "correcthorsebatterystaple"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + # TODO: Add your SSH public key(s) here, if you plan on using SSH to connect + ]; + # TODO: Be sure to add any other groups you need (such as networkmanager, audio, docker, etc) + extraGroups = ["wheel"]; + }; + }; + + # This setups a SSH server. Very important if you're setting up a headless system. + # Feel free to remove if you don't need it. + services.openssh = { + enable = true; + settings = { + # Forbid root login through SSH. + PermitRootLogin = "no"; + # Use keys only. Remove if you want to SSH using password (not recommended) + PasswordAuthentication = false; + }; + }; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/nixos/hardware-configuration.nix b/nixos/hardware-configuration.nix new file mode 100644 index 0000000..dd00939 --- /dev/null +++ b/nixos/hardware-configuration.nix @@ -0,0 +1,10 @@ +# This is just an example, you should generate yours with nixos-generate-config and put it in here. +{ + fileSystems."/" = { + device = "/dev/sda1"; + fsType = "ext4"; + }; + + # Set your system kind (needed for flakes) + nixpkgs.hostPlatform = "x86_64-linux"; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..a13ea3c --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,23 @@ +# This file defines overlays +{inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs {pkgs = final;}; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; + + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..3d9e23c --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,5 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' +pkgs: { + # example = pkgs.callPackage ./example { }; +}