From 69577756e5e60b27f0d7e2241fc3dce73b52f252 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Wed, 15 Mar 2023 22:11:59 +0530 Subject: [PATCH] add current system config --- flake.lock | 539 +++++++++++++++++++++ flake.nix | 56 +++ home/default.nix | 73 +++ home/dev.nix | 43 ++ home/downloader.nix | 20 + home/firefox.nix | 85 ++++ home/kitty.nix | 34 ++ home/media.nix | 38 ++ home/nvim.nix | 144 ++++++ home/persistence.nix | 36 ++ home/scripts.nix | 67 +++ home/sway/default.nix | 207 ++++++++ home/sway/gnome-keyring.nix | 7 + home/sway/gtk.nix | 45 ++ home/sway/kanshi.nix | 33 ++ home/sway/mako.nix | 22 + home/sway/rofi/default.nix | 12 + home/sway/rofi/theme.rasi | 80 +++ home/sway/swayidle.nix | 11 + home/sway/wallpapers.nix | 27 ++ home/sway/waybar/colors.css | 12 + home/sway/waybar/default.nix | 93 ++++ home/sway/waybar/style.css | 110 +++++ home/terminal.nix | 75 +++ home/tmux.nix | 45 ++ home/virt-manager.nix | 18 + packages/adi1090x-plymouth/default.nix | 33 ++ packages/catppuccin-wallpapers/default.nix | 28 ++ packages/default.nix | 6 + packages/dracula-gtk/default.nix | 36 ++ packages/newaita-icon-theme/default.nix | 54 +++ system/default.nix | 86 ++++ system/disk.nix | 15 + system/filesystem.nix | 32 ++ system/gnome-keyring.nix | 7 + system/gtk.nix | 4 + system/hardware.nix | 28 ++ system/kernel.nix | 21 + system/nix.nix | 15 + system/packages.nix | 24 + system/persistence.nix | 23 + system/plymouth.nix | 10 + system/secureboot.nix | 12 + system/services.nix | 23 + system/swaylock.nix | 5 + system/virtualisation.nix | 13 + users/default.nix | 20 + users/user.nix | Bin 0 -> 464 bytes 48 files changed, 2427 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 home/default.nix create mode 100644 home/dev.nix create mode 100644 home/downloader.nix create mode 100644 home/firefox.nix create mode 100644 home/kitty.nix create mode 100644 home/media.nix create mode 100644 home/nvim.nix create mode 100644 home/persistence.nix create mode 100644 home/scripts.nix create mode 100644 home/sway/default.nix create mode 100644 home/sway/gnome-keyring.nix create mode 100644 home/sway/gtk.nix create mode 100644 home/sway/kanshi.nix create mode 100644 home/sway/mako.nix create mode 100644 home/sway/rofi/default.nix create mode 100644 home/sway/rofi/theme.rasi create mode 100644 home/sway/swayidle.nix create mode 100644 home/sway/wallpapers.nix create mode 100644 home/sway/waybar/colors.css create mode 100644 home/sway/waybar/default.nix create mode 100644 home/sway/waybar/style.css create mode 100644 home/terminal.nix create mode 100644 home/tmux.nix create mode 100644 home/virt-manager.nix create mode 100644 packages/adi1090x-plymouth/default.nix create mode 100644 packages/catppuccin-wallpapers/default.nix create mode 100644 packages/default.nix create mode 100644 packages/dracula-gtk/default.nix create mode 100644 packages/newaita-icon-theme/default.nix create mode 100644 system/default.nix create mode 100644 system/disk.nix create mode 100644 system/filesystem.nix create mode 100644 system/gnome-keyring.nix create mode 100644 system/gtk.nix create mode 100644 system/hardware.nix create mode 100644 system/kernel.nix create mode 100644 system/nix.nix create mode 100644 system/packages.nix create mode 100644 system/persistence.nix create mode 100644 system/plymouth.nix create mode 100644 system/secureboot.nix create mode 100644 system/services.nix create mode 100644 system/swaylock.nix create mode 100644 system/virtualisation.nix create mode 100644 users/default.nix create mode 100644 users/user.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..e8992c7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,539 @@ +{ + "nodes": { + "crane": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": [ + "lanzaboote", + "flake-utils" + ], + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ], + "rust-overlay": [ + "lanzaboote", + "rust-overlay" + ] + }, + "locked": { + "lastModified": 1673056065, + "narHash": "sha256-a68tMDTDqdAauxq377ALl4Uwm6oh9MeoY2WbTYRWZoo=", + "owner": "ipetkov", + "repo": "crane", + "rev": "0144134311767fcee80213321f079a8ffa0b9cc1", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "devenv": { + "inputs": { + "flake-compat": "flake-compat", + "nix": "nix", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1678113758, + "narHash": "sha256-mD3SkN43b1s5CJ8Rx3l2oK3Dqgs+6Ze0FfWrdMcrrYk=", + "owner": "cachix", + "repo": "devenv", + "rev": "6455f319fc90e0be2071327093c5458f9afc61bf", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "latest", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1673047662, + "narHash": "sha256-dXYxH/0Ea5oQSkGAWWNy7HzmFutguycDGn2dt6lTYRQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "aa1f6ca773b6e740037ebfb35f7010e0c3960638", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "devenv", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "lanzaboote", + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1678881218, + "narHash": "sha256-ZiKspOZ9MpwHRXJRxagjtT4WdN3xL0lno7J/c0cXeCk=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "85196310e1aceb1d91ff4fb5ac5cd6e1f630a66a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "impermanence": { + "locked": { + "lastModified": 1675359654, + "narHash": "sha256-FPxzuvJkcO49g4zkWLSeuZkln54bLoTtrggZDJBH90I=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "6138eb8e737bffabd4c8fc78ae015d4fd6a7e2fd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "impermanence", + "type": "github" + } + }, + "lanzaboote": { + "inputs": { + "crane": "crane", + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts", + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-test": "nixpkgs-test", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1678750306, + "narHash": "sha256-su+fOHbn84IWoOVxNTEhMF3RBdf9Yy5BPbMsgRajdD0=", + "owner": "nix-community", + "repo": "lanzaboote", + "rev": "8aad4af5ad0654c239a0c54179a01c48f310035b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "lanzaboote", + "type": "github" + } + }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1676545802, + "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", + "owner": "domenkozar", + "repo": "nix", + "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "relaxed-flakes", + "repo": "nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1678815914, + "narHash": "sha256-LveHTkKxFjX3OkxIr13KWv3iRyMbnNU4GX1r1fLBTyA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d1d7c60984649992cecd884d3576dc45363e8895", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1672350804, + "narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1673800717, + "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1671271954, + "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-test": { + "locked": { + "lastModified": 1671812130, + "narHash": "sha256-GALBK+qB9rhnB+lVnxdgtMoXCySXughZZ3+qGO1Ke/k=", + "owner": "RaitoBezarius", + "repo": "nixpkgs", + "rev": "e51bf8cc8e2c75192e930ad83ed272938729e7be", + "type": "github" + }, + "original": { + "owner": "RaitoBezarius", + "ref": "simplified-qemu-boot-disks", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1678654296, + "narHash": "sha256-aVfw3ThpY7vkUeF1rFy10NAkpKDS2imj3IakrzT0Occ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5a1dc8acd977ff3dccd1328b7c4a6995429a656b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1677160285, + "narHash": "sha256-tBzpCjMP+P3Y3nKLYvdBkXBg3KvTMo3gvi8tLQaqXVY=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "2bd861ab81469428d9c823ef72c4bb08372dd2c4", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": [ + "lanzaboote", + "flake-utils" + ], + "gitignore": "gitignore_2", + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1672912243, + "narHash": "sha256-QnQeKUjco2kO9J4rBqIBPp5XcOMblIMnmyhpjeaJBYc=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "a4548c09eac4afb592ab2614f4a150120b29584c", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "home-manager": "home-manager", + "impermanence": "impermanence", + "lanzaboote": "lanzaboote", + "nixpkgs": "nixpkgs_2" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "lanzaboote", + "flake-utils" + ], + "nixpkgs": [ + "lanzaboote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673058265, + "narHash": "sha256-FFigGHIO9BQeIIKjH5dcpB+ey5CSgfy47wHPGeOhCps=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "802ff3314663ec7114f29a6e8b200dfc892023f8", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3f05d93 --- /dev/null +++ b/flake.nix @@ -0,0 +1,56 @@ +{ + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + lanzaboote = { + url = "github:nix-community/lanzaboote/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + impermanence = { + url = "github:nix-community/impermanence/master"; + }; + + home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + devenv = { + url = "github:cachix/devenv/latest"; + }; + }; + + outputs = { self, devenv, nixpkgs, home-manager, impermanence, lanzaboote }@inputs: { + nixosConfigurations = { + Skipper = nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + specialArgs = { + inherit devenv impermanence system; + }; + modules = [ + ./system/nix.nix + + { + nixpkgs.overlays = [ + (import ./packages) # Overlay adding all custom packages + (self: super: { devenv = devenv.packages.${system}.devenv; }) # Overlay for devenv.sh + ]; + } + + { system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; } + + home-manager.nixosModules.home-manager + impermanence.nixosModules.impermanence + lanzaboote.nixosModules.lanzaboote + + ./system + ./users + ./home + ]; + }; + }; + }; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..c9d7493 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,73 @@ +{ impermanence, pkgs, ... }: +let + user = import ../users/user.nix; +in +{ + programs.fuse.userAllowOther = true; + + fileSystems."/home/${user.primary.userName}" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "mode=0755" "uid=1000" "gid=100" ]; + }; + + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.${user.primary.userName} = { pkgs, ... }: { + + imports = [ + impermanence.nixosModules.home-manager.impermanence + + ./dev.nix + ./downloader.nix + ./firefox.nix + ./media.nix + ./persistence.nix + ./scripts.nix + ./sway + ./terminal.nix + ./virt-manager.nix + ]; + + home.packages = with pkgs; [ + _1password-gui + brightnessctl + discord + evince + gnome.eog + gnome.gnome-system-monitor + gnome3.gnome-disk-utility + libsecret + pantheon.elementary-files + pavucontrol + xdg-utils + ]; + + dconf.settings = { + "io/elementary/files/preferences" = { + "singleclick-select" = true; + }; + "org/gtk/settings/file-chooser" = { + "sort-directories-first" = true; + }; + }; + + programs = { + gpg = { + enable = true; + settings = { + keyserver = "hkps://keys.openpgp.org"; + }; + }; + }; + + services.blueman-applet.enable = true; + + xdg.enable = true; + xdg.mime.enable = true; + xdg.mimeApps.enable = true; + xdg.userDirs.enable = true; + + home.stateVersion = "23.05"; + }; +} diff --git a/home/dev.nix b/home/dev.nix new file mode 100644 index 0000000..86e8ea8 --- /dev/null +++ b/home/dev.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: +let + user = import ../users/user.nix; +in +{ + imports = [ + ./nvim.nix + ]; + + home.packages = with pkgs; [ + devenv + git-crypt + lazydocker + nixpkgs-fmt + ripgrep + ]; + programs = { + gh = { + enable = true; + settings.git_protocol = "ssh"; + extensions = [ pkgs.gh-dash ]; + }; + git = { + enable = true; + diff-so-fancy = { + enable = true; + }; + userEmail = user.primary.emailAddress; + userName = user.primary.realName; + signing = { + key = user.primary.signingKey; + signByDefault = true; + }; + extraConfig = { + init.defaultBranch = "main"; + }; + ignores = [ "/.nix" "/.direnv" ]; + }; + lazygit = { + enable = true; + }; + }; +} diff --git a/home/downloader.nix b/home/downloader.nix new file mode 100644 index 0000000..c1300fa --- /dev/null +++ b/home/downloader.nix @@ -0,0 +1,20 @@ +{ ... }: { + programs = { + aria2 = { + enable = true; + settings = { + continue = true; + file-allocation = "falloc"; + max-connection-per-server = 8; + split = 8; + min-split-size = "1M"; + }; + }; + yt-dlp = { + enable = true; + settings = { + downloader = "aria2c"; + }; + }; + }; +} diff --git a/home/firefox.nix b/home/firefox.nix new file mode 100644 index 0000000..dad1179 --- /dev/null +++ b/home/firefox.nix @@ -0,0 +1,85 @@ +{ pkgs, ... }: +{ + programs = { + firefox = { + enable = true; + package = + (pkgs.firefox.override { + extraPolicies = { + DontCheckDefaultBrowser = true; + DisablePocket = true; + DisableTelemetry = true; + DisplayBookmarksToolbar = "always"; + EnableTrackingProtection = { + "Value" = true; + "Locked" = true; + "Cryptomining" = true; + "Fingerprinting" = true; + }; + FirefoxHome = { + "Search" = true; + "TopSites" = false; + "SponsoredTopSites" = false; + "Highlights" = false; + "Pocket" = false; + "SponsoredPocket" = false; + "Snippets" = false; + "Locked" = true; + }; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + SearchSuggestEnabled = false; + StartDownloadsInTempDirectory = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + ExtensionSettings = { + "{b743f56d-1cc1-4048-8ba6-f9c2ab7aa54d}" = { + "allowed_types" = "theme"; + "installation_mode" = "force_installed"; + "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/dracula-dark-colorscheme/latest.xpi"; + }; + "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + "allowed_types" = "extension"; + "installation_mode" = "force_installed"; + "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + }; + "queryamoid@kaply.com" = { + "allowed_types" = "extension"; + "installation_mode" = "force_installed"; + "install_url" = "https://github.com/mkaply/queryamoid/releases/download/v0.2/query_amo_addon_id-0.2-fx.xpi"; + }; + }; + Preferences = { + "browser.crashReports.unsubmittedCheck.autoSubmit2" = { Value = false; Status = "locked"; }; + "browser.selfsupport.url" = { Value = ""; Status = "locked"; }; + "browser.aboutConfig.showWarning" = { Value = false; Status = "locked"; }; + "browser.aboutHomeSnippets.updateUrl" = { Value = ""; Status = "locked"; }; + "browser.startup.homepage_override.mstone" = { Value = "ignore"; Status = "locked"; }; + "browser.startup.homepage_override.buildID" = { Value = ""; Status = "locked"; }; + "browser.tabs.firefox-view" = { Value = false; Status = "locked"; }; + "dom.event.contextmenu.enabled" = { Value = false; Status = "locked"; }; + "dom.event.clipboardevents.enabled" = { Value = false; Status = "locked"; }; + "dom.security.https_only_mode" = { Value = true; Status = "locked"; }; + "extensions.htmlaboutaddons.recommendations.enabled" = { Value = false; Status = "locked"; }; + "extensions.recommendations.themeRecommendationUrl" = { Value = ""; Status = "locked"; }; + "network.IDN_show_punycode" = { Value = true; Status = "locked"; }; + }; + }; + }); + profiles.default = { + id = 0; + name = "Default"; + isDefault = true; + settings = { + "app.shield.optoutstudies.enabled" = false; + "identity.fxaccounts.account.device.name" = "Skipper"; + "privacy.donottrackheader.enabled" = true; + "privacy.firstparty.isolate" = true; + "startup.homepage_welcome_url" = ""; + "startup.homepage_welcome_url.additional" = ""; + "startup.homepage_override_url" = ""; + }; + }; + }; + }; +} diff --git a/home/kitty.nix b/home/kitty.nix new file mode 100644 index 0000000..68ad834 --- /dev/null +++ b/home/kitty.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: +let + dracula = pkgs.fetchFromGitHub { + owner = "dracula"; + repo = "kitty"; + rev = "87717a3f00e3dff0fc10c93f5ff535ea4092de70"; + hash = "sha256-78PTH9wE6ktuxeIxrPp0ZgRI8ST+eZ3Ok2vW6BCIZkc="; + }; +in +{ + programs.kitty = { + enable = true; + font.package = (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }); + font.name = "FiraCode Nerd Font"; + extraConfig = '' + font_size 14 + initial_window_width 100c + initial_window_height 25c + window_padding_width 4.0 + background_opacity 0.98 + cursor_shape beam + scrollback_lines 2000 + copy_on_select clipboard + url_style curly + sync_to_monitor yes + shell_integration disabled + + include ${dracula}/dracula.conf + ''; + settings = { + enable_audio_bell = false; + }; + }; +} diff --git a/home/media.nix b/home/media.nix new file mode 100644 index 0000000..105103e --- /dev/null +++ b/home/media.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + celluloid + spotify + spotify-tui + playerctl + ]; + programs.mpv = { + enable = true; + package = pkgs.mpv.override { youtubeSupport = true; }; + config = { + hwdec = "auto-safe"; + gpu-context = "wayland"; + }; + defaultProfiles = [ "gpu-hq" ]; + scripts = with pkgs.mpvScripts; [ mpris ]; + }; + services = { + spotifyd = { + enable = true; + package = (pkgs.spotifyd.override { withKeyring = true; withMpris = true; }); + settings = { + global = { + use_keyring = true; + use_mpris = true; + username_cmd = '' + ${pkgs.libsecret}/bin/secret-tool search --all service spotifyd 2>&1 | grep 'username' | awk -F'= ' '{print $2}' + ''; + device_name = "Skipperd"; + device_type = "computer"; + backend = "pulseaudio"; + no_audio_cache = true; + dbus_type = "session"; + }; + }; + }; + }; +} diff --git a/home/nvim.nix b/home/nvim.nix new file mode 100644 index 0000000..decef80 --- /dev/null +++ b/home/nvim.nix @@ -0,0 +1,144 @@ +{ pkgs, ... }: + +{ + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + withNodeJs = true; + withPython3 = true; + withRuby = true; + extraLuaConfig = '' + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + ''; + extraPackages = with pkgs; [ + fd + ripgrep + rnix-lsp + tree-sitter + ]; + plugins = with pkgs.vimPlugins; [ + dracula-nvim + neo-tree-nvim + (nvim-treesitter.withPlugins (plugins: with plugins; [ bash dockerfile gitcommit gitignore git_rebase go markdown markdown_inline nix rust toml yaml ])) + nvim-treesitter-context + nvim-treesitter-refactor + telescope-nvim + vim-fugitive + vim-go + vim-nix + rust-vim + { + plugin = bufferline-nvim; + type = "lua"; + config = '' + require("bufferline").setup{ + options = { + offsets = { + { + filetype = "neo-tree", + separator = true + } + }, + diagnostics = "nvim_lsp", + separator_style = "slant", + truncate_names = true + } + } + ''; + } + { + plugin = git-blame-nvim; + config = '' + let g:gitblame_date_format = '%r' + let g:gitblame_message_when_not_committed = ''' + ''; + } + { + plugin = gitsigns-nvim; + type = "lua"; + config = '' + require('gitsigns').setup() + ''; + } + { + plugin = lualine-nvim; + type = "lua"; + config = '' + require('lualine').setup { + options = { + icons_enabled = true, + theme = 'dracula', + globalstatus = true + } + } + ''; + } + { + plugin = nvim-lastplace; + type = "lua"; + config = '' + require('nvim-lastplace').setup{} + ''; + } + { + plugin = nvim-lspconfig; + type = "lua"; + config = '' + require('lspconfig').gopls.setup{} + require('lspconfig').rnix.setup{} + require('lspconfig').rust_analyzer.setup{} + ''; + } + { + plugin = nvim-web-devicons; + type = "lua"; + config = '' + require('nvim-web-devicons').setup { + default = true; + } + ''; + } + { + plugin = toggleterm-nvim; + type = "lua"; + config = '' + require('toggleterm').setup{} + ''; + } + ]; + extraConfig = '' + set autowrite + set background=dark + set clipboard+=unnamedplus + set expandtab + set laststatus=2 + set list + set noshowmode + set noswapfile + set number + set relativenumber + set shiftwidth=2 + set signcolumn=yes + set smartindent + set tabstop=2 + set termguicolors + set updatetime=100 + set wrap + + colorscheme dracula + + nmap gT + nmap gt + nnoremap :noh + nnoremap ` :ToggleTerm + nnoremap 1 :NeoTreeFocusToggle + nnoremap ff Telescope find_files + nnoremap fg Telescope live_grep + nnoremap fb Telescope buffers + nnoremap fh Telescope help_tags + ''; + }; +} diff --git a/home/persistence.nix b/home/persistence.nix new file mode 100644 index 0000000..9c2cd56 --- /dev/null +++ b/home/persistence.nix @@ -0,0 +1,36 @@ +{ ... }: { + home.persistence."/persist/home" = { + allowOther = true; + directories = [ + ".cache/mesa_shader_cache" + ".cache/mozilla" + ".cache/nix" + ".config/1Password" + ".config/dconf" + ".config/discord" + ".config/lazygit" + ".config/spotify" + ".config/spotify-tui" + ".gnupg" + ".local/share/atuin" + ".local/share/keyrings" + ".local/share/nix" + ".local/share/zsh" + ".mozilla" + ".nixos-config" + ".ssh" + + "Documents" + "Downloads" + "Music" + "Others" + "Pictures" + "Projects" + "Videos" + ]; + + files = [ + ".config/gh/hosts.yml" + ]; + }; +} diff --git a/home/scripts.nix b/home/scripts.nix new file mode 100644 index 0000000..9312142 --- /dev/null +++ b/home/scripts.nix @@ -0,0 +1,67 @@ +{ pkgs, ... }: + +{ + xdg.configFile."scripts/power_menu.sh" = { + text = '' + #!/bin/sh + + set -eu + + chpower() { + case "$1" in + "") + ;; + Shutdown) + exec systemctl poweroff + ;; + Reboot) + exec systemctl reboot + ;; + Hibernate) + exec systemctl hibernate + ;; + Logout) + swaymsg exit + ;; + *) + ${pkgs.libnotify}/bin/notify-send -t 1500 -u low "Invalid Option" + ;; + esac + } + + OPTIONS="Shutdown\nReboot\nHibernate\nLogout" + + chpower "$(printf "%b" "$OPTIONS" | sort | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "Power Menu")" + ''; + executable = true; + }; + + xdg.configFile."scripts/volume_up.sh" = { + text = '' + #!/bin/sh + + set -eu + + ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 + [ $(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk -F': ' '{print $2}' | sed 's/\.//') -lt 100 ] && ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ + ''; + executable = true; + }; + + xdg.configFile."scripts/tmux_sessions.sh" = { + text = '' + #!/bin/sh + + set -eu + + SESSION="$(${pkgs.tmux}/bin/tmux list-sessions -F "(#{session_attached}) #S [#{pane_current_command} in #{pane_current_path}] #{pane_title}" | sort | ${pkgs.rofi-wayland}/bin/rofi -dmenu -p "Running TMUX Sessions" | awk '{print $2}')" + case "$SESSION" in + "") + ;; + *) + ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux -u attach-session -dEt "$SESSION" + ;; + esac''; + executable = true; + }; +} diff --git a/home/sway/default.nix b/home/sway/default.nix new file mode 100644 index 0000000..1edb38b --- /dev/null +++ b/home/sway/default.nix @@ -0,0 +1,207 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./gnome-keyring.nix + ./gtk.nix + ./kanshi.nix + ./mako.nix + ./rofi + ./swayidle.nix + ./wallpapers.nix + ./waybar + ]; + + home.packages = with pkgs; [ + wl-clipboard + ]; + + wayland.windowManager.sway.enable = true; + wayland.windowManager.sway.package = pkgs.sway; + wayland.windowManager.sway.config.modifier = "Mod4"; + wayland.windowManager.sway.config.bars = [ ]; + wayland.windowManager.sway.xwayland = true; + wayland.windowManager.sway.config.fonts = { + names = [ "FiraCode Nerd Font" ]; + size = 11.0; + }; + wayland.windowManager.sway.config.input = { + "type:touchpad" = { + dwt = "enabled"; + tap = "enabled"; + natural_scroll = "enabled"; + middle_emulation = "enabled"; + }; + }; + wayland.windowManager.sway.systemdIntegration = true; + wayland.windowManager.sway.wrapperFeatures = { + gtk = true; + }; + wayland.windowManager.sway.config.colors = { + background = "#F8F8F2"; + focused = { + background = "#6272A4"; + border = "#6272A4"; + childBorder = "#6272A4"; + indicator = "#6272A4"; + text = "#F8F8F2"; + }; + focusedInactive = { + background = "#44475A"; + border = "#44475A"; + childBorder = "#44475A"; + indicator = "#44475A"; + text = "#F8F8F2"; + }; + placeholder = { + background = "#282A36"; + border = "#282A36"; + childBorder = "#282A36"; + indicator = "#282A36"; + text = "#F8F8F2"; + }; + unfocused = { + background = "#282A36"; + border = "#282A36"; + childBorder = "#282A36"; + indicator = "#282A36"; + text = "#BFBFBF"; + }; + urgent = { + background = "#FF5555"; + border = "#44475A"; + childBorder = "#FF5555"; + indicator = "#FF5555"; + text = "#F8F8F2"; + }; + }; + + wayland.windowManager.sway.config.seat = { + "*" = { + xcursor_theme = "Bibata-Modern-Classic 24"; + }; + }; + + wayland.windowManager.sway.config.keybindings = + let + modifier = config.wayland.windowManager.sway.config.modifier; + in + lib.mkOptionDefault { + "${modifier}+Return" = "exec ${pkgs.kitty}/bin/kitty ${pkgs.tmux}/bin/tmux new"; + "${modifier}+Shift+Return" = "exec ${pkgs.kitty}/bin/kitty"; + "${modifier}+d" = "exec ${pkgs.rofi-wayland}/bin/rofi -show drun"; + "${modifier}+Shift+c" = "reload"; + "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; + "${modifier}+Shift+w" = "exec ~/.config/scripts/chpaper.sh"; + "${modifier}+Shift+escape" = "exec ~/.config/scripts/power_menu.sh"; + "${modifier}+f11" = "exec ~/.config/scripts/tmux_sessions.sh"; + + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%"; + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; + + "XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "XF86AudioRaiseVolume" = "exec ~/.config/scripts/volume_up.sh"; + "XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + + "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; + "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; + + "print" = ''exec ${pkgs.grim}/bin/grim "''$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"''; + "Shift+print" = ''exec ${pkgs.grim}/bin/grim -g "''$(${pkgs.slurp}/bin/slurp)" "''$(${pkgs.xdg-user-dirs}/bin/xdg-user-dir PICTURES)/Screenshots/screenshot-''$(date +%Y-%m-%d-%H-%M-%S).png"''; + }; + + wayland.windowManager.sway.config.startup = [ + { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } + { command = "~/.config/scripts/chpaper.sh"; always = true; } + { command = "systemctl --user restart waybar.service"; always = true; } + { command = "systemctl --user restart kanshi.service"; always = true; } + ]; + + wayland.windowManager.sway.config.window.commands = [ + { + command = "floating enable, focus"; + criteria = { + app_id = "pavucontrol"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "blueman-manager"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "solaar"; + }; + } + { + command = "floating enable, focus, sticky enable, resize set width 99ppt"; + criteria = { + app_id = "mpv"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "eog"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "io.elementary.files"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "gnome-system-monitor"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "virt-manager"; + }; + } + { + command = "floating enable, focus"; + criteria = { + class = "1Password"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "io.github.celluloid_player.Celluloid"; + }; + } + { + command = "floating enable, focus"; + criteria = { + app_id = "gnome-disks"; + }; + } + { + command = "move container to workspace 2, focus"; + criteria = { + app_id = "firefox"; + }; + } + { + command = "move container to workspace 9, focus"; + criteria = { + class = "Spotify"; + }; + } + ]; + + wayland.windowManager.sway.config.gaps.outer = 2; + wayland.windowManager.sway.config.gaps.inner = 2; + wayland.windowManager.sway.config.window.titlebar = false; + wayland.windowManager.sway.config.floating.titlebar = false; +} + diff --git a/home/sway/gnome-keyring.nix b/home/sway/gnome-keyring.nix new file mode 100644 index 0000000..2312f74 --- /dev/null +++ b/home/sway/gnome-keyring.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + services.gnome-keyring.enable = true; + services.gpg-agent.enable = true; + services.gpg-agent.pinentryFlavor = "gnome3"; +} diff --git a/home/sway/gtk.nix b/home/sway/gtk.nix new file mode 100644 index 0000000..162da6a --- /dev/null +++ b/home/sway/gtk.nix @@ -0,0 +1,45 @@ +{ lib, pkgs, ... }: +let + gtkTheme = { + name = "Dracula"; + package = pkgs.dracula-gtk; + }; + + iconTheme = { + name = "Newaita-dark"; + package = pkgs.newaita-icon-theme.override { panel = "dark"; folder = "bluegray"; }; + }; + + cursorTheme = { + name = "Bibata-Modern-Classic"; + package = pkgs.bibata-cursors; + }; +in +{ + gtk.enable = true; + gtk.theme = gtkTheme; + home.sessionVariables.GTK_THEME = gtkTheme.name; + xdg.configFile = { + "gtk-4.0/assets".source = "${gtkTheme.package}/share/themes/${gtkTheme.name}/gtk-4.0/assets"; + "gtk-4.0/gtk.css".source = "${gtkTheme.package}/share/themes/${gtkTheme.name}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${gtkTheme.package}/share/themes/${gtkTheme.name}/gtk-4.0/gtk-dark.css"; + }; + + gtk.cursorTheme = cursorTheme; + + gtk.iconTheme = iconTheme; + + gtk.gtk3.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + + gtk.gtk4.extraConfig = { + gtk-application-prefer-dark-theme = true; + }; + + dconf.settings = { + "org/gnome/desktop/interface" = { + "color-scheme" = "prefer-dark"; + }; + }; +} diff --git a/home/sway/kanshi.nix b/home/sway/kanshi.nix new file mode 100644 index 0000000..e2449c2 --- /dev/null +++ b/home/sway/kanshi.nix @@ -0,0 +1,33 @@ +{ ... }: + +{ + services.kanshi.enable = true; + services.kanshi.profiles = { + undocked = { + outputs = [ + { + criteria = "eDP-1"; + mode = "1920x1080"; + position = "0,0"; + } + ]; + }; + docked = { + outputs = [ + { + criteria = "eDP-1"; + transform = "normal"; + mode = "1920x1080"; + position = "0,360"; + scale = 1.5; + } + { + criteria = "DP-1"; + transform = "normal"; + mode = "1920x1080"; + position = "1280,0"; + } + ]; + }; + }; +} diff --git a/home/sway/mako.nix b/home/sway/mako.nix new file mode 100644 index 0000000..0d1676a --- /dev/null +++ b/home/sway/mako.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +{ + services.mako = { + enable = true; + font = "FiraCode Nerd Font 11"; + backgroundColor = "#282A36"; + borderColor = "#282A36"; + progressColor = "over #313244"; + textColor = "#44475A"; + extraConfig = '' + [urgency=low] + border-color=#282a36 + + [urgency=normal] + border-color=#f1fa8c + + [urgency=high] + border-color=#ff5555 + ''; + }; +} diff --git a/home/sway/rofi/default.nix b/home/sway/rofi/default.nix new file mode 100644 index 0000000..bcfbc98 --- /dev/null +++ b/home/sway/rofi/default.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + programs.rofi = { + enable = true; + cycle = false; + package = pkgs.rofi-wayland; + font = "FiraCode Nerd Font 16"; + extraConfig = { + show-icons = true; + }; + theme = ./theme.rasi; + }; +} diff --git a/home/sway/rofi/theme.rasi b/home/sway/rofi/theme.rasi new file mode 100644 index 0000000..c784d64 --- /dev/null +++ b/home/sway/rofi/theme.rasi @@ -0,0 +1,80 @@ +configuration { + font: "FiraCode Nerd Font 14"; + + drun { + display-name: ""; + } + + run { + display-name: ""; + } + + window { + display-name: ""; + } + + timeout { + delay: 10; + action: "kb-cancel"; + } +} + +* { + border: 0; + margin: 0; + padding: 0; + spacing: 0; + + bg: #282a36; + fg: #f8f8f2; + blue: #6272a4; + purple: #bd93f9; + + background-color: @bg; + text-color: @fg; +} + +window { + transparency: "real"; +} + +mainbox { + children: [inputbar, listview]; +} + +inputbar { + background-color: @blue; + children: [prompt, entry]; +} + +entry { + background-color: inherit; + padding: 12px 3px; +} + +prompt { + background-color: inherit; + padding: 12px; +} + +listview { + lines: 8; +} + +element { + children: [element-icon, element-text]; + text-color: @blue; +} + +element-icon { + padding: 10px 10px; +} + +element-text { + padding: 10px 0; + text-color: inherit; +} + +element-text selected { + text-color: @purple; +} diff --git a/home/sway/swayidle.nix b/home/sway/swayidle.nix new file mode 100644 index 0000000..111dd37 --- /dev/null +++ b/home/sway/swayidle.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + services.swayidle.enable = true; + services.swayidle.events = [ + { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } + ]; + services.swayidle.timeouts = [ + { timeout = 600; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } + ]; +} diff --git a/home/sway/wallpapers.nix b/home/sway/wallpapers.nix new file mode 100644 index 0000000..4155c5d --- /dev/null +++ b/home/sway/wallpapers.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: + +{ + xdg.dataFile."wallpapers/catppuccin".source = "${pkgs.catppuccin-wallpapers}/share/wallpapers"; + xdg.configFile."scripts/chpaper.sh" = { + text = '' + #!/bin/sh + + set -eu + + DIR="''${HOME}/.local/share/wallpapers" + + random_paper() { + find -L "''${DIR}"/ -type f -regextype egrep -regex ".*\.(jpe?g|png)$" | shuf -n1 + } + + SWAYSOCK="''${SWAYSOCK:-""}" + if [ -z "''${SWAYSOCK}" ] ; then + SWAYSOCK="$(find /run/user/"$(id -u)"/ -name "sway-ipc.$(id -u).*.sock")" + export SWAYSOCK + fi + ${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/wallpaper.jpg && swaymsg "output * bg '/tmp/wallpaper.jpg' fill" & + ${pkgs.imagemagick}/bin/convert "$(random_paper)" /tmp/lockpaper.jpg + ''; + executable = true; + }; +} diff --git a/home/sway/waybar/colors.css b/home/sway/waybar/colors.css new file mode 100644 index 0000000..be22e66 --- /dev/null +++ b/home/sway/waybar/colors.css @@ -0,0 +1,12 @@ +@define-color background #282a36; +@define-color foreground #f8f8f2; +@define-color selection #44475a; +@define-color unfocused #6272a4; +@define-color red #ff5555; +@define-color green #50fa7b; +@define-color yellow #f1fa8c; +@define-color cyan #8be9fd; +@define-color purple #bd93f9; +@define-color pink #ff79c6; +@define-color orange #ffb86c; + diff --git a/home/sway/waybar/default.nix b/home/sway/waybar/default.nix new file mode 100644 index 0000000..2ecf0b2 --- /dev/null +++ b/home/sway/waybar/default.nix @@ -0,0 +1,93 @@ +{ pkgs, ... }: + +{ + programs.waybar.enable = true; + programs.waybar.systemd.enable = true; + programs.waybar.style = ./style.css; + xdg.configFile."waybar/colors.css".source = ./colors.css; + programs.waybar.settings = { + mainBar = { + layer = "top"; + position = "top"; + height = 28; + modules-left = [ "sway/workspaces" "sway/window" "sway/mode" ]; + modules-center = [ ]; + modules-right = [ "tray" "idle_inhibitor" "network" "bluetooth" "pulseaudio" "backlight" "battery" "clock" ]; + "sway/mode" = { + "format" = "{}"; + }; + "sway/window" = { + "tooltip" = false; + }; + "idle_inhibitor" = { + "format" = "{icon}"; + "format-icons" = { + "activated" = ""; + "deactivated" = ""; + }; + "tooltip" = false; + }; + "clock" = { + "tooltip" = false; + "interval" = 1; + "format" = "{:%I:%M}"; + "format-alt" = "{:%d %B %Y, %A}"; + }; + "backlight" = { + "format" = "{icon}"; + "format-icons" = [ "" "" "" "" ]; + }; + "battery" = { + "states" = { + "good" = 90; + "warning" = 20; + "critical" = 10; + }; + "format" = "{icon}"; + "format-alt" = "{icon} {capacity}% ({time})"; + "format-charging" = " {capacity}%"; + "format-plugged" = "‭ﮣ {capacity}%"; + "format-icons" = [ "" "" "" "" "" "" "" "" "" "" "" ]; + "tooltip" = false; + }; + "network" = { + "format-wifi" = "直"; + "format-ethernet" = ""; + "format-linked" = ""; + "format-disconnected" = "睊"; + "format-alt" = "{ifname}: {ipaddr}/{cidr}"; + "tooltip" = false; + }; + "pulseaudio" = { + "tooltip" = false; + "format" = "{icon} {format_source}"; + "format-muted" = "‭ﱝ {format_source}"; + "format-bluetooth" = " {icon} {format_source}"; + "format-bluetooth-muted" = " ‭ﱝ {format_source}"; + "format-source" = ""; + "format-source-muted" = ""; + "format-icons" = { + "headphones" = ""; + "handsfree" = ""; + "headset" = ""; + "phone" = ""; + "portable" = ""; + "car" = ""; + "default" = [ "奄" "奔" "墳" ]; + }; + "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; + }; + "bluetooth" = { + "format" = ""; + "format-connected" = ""; + "format-disabled" = ""; + "format-off" = ""; + "format-connected-battery" = " {device_battery_percentage}%"; + "on-click" = "${pkgs.blueman}/bin/blueman-manager"; + }; + "tray" = { + "spacing" = 4; + }; + }; + }; +} diff --git a/home/sway/waybar/style.css b/home/sway/waybar/style.css new file mode 100644 index 0000000..122de45 --- /dev/null +++ b/home/sway/waybar/style.css @@ -0,0 +1,110 @@ +@import "colors.css"; + +* { + border: none; + border-radius: 0px; + font-family: 'FiraCode Nerd Font'; + font-size: 16px; + min-height: 0; +} + +#window { + padding: 0px 10px; + background: @background; +} + +window#waybar { + background: @background; + color: @foreground; +} + +window#waybar.hidden { + opacity: 0.2; +} + +window#waybar.empty { + background: @background; +} + +window#waybar.solo { + background: @background; +} + +#workspaces button { + padding: 0px 3px; + background: @background; + color: @foreground; +} + +#workspaces button.focused { + color: @green; +} + +#workspaces button.urgent { + background: @background; + color: @red; +} + +#mode { + background: @background; + border: 3px solid @purple; +} + +#clock, +#battery, +#backlight, +#network, +#pulseaudio, +#tray, +#mode, +#idle_inhibitor, +#bluetooth { + padding: 0 10px; + color: @foreground; + background-color: @background; +} + +@keyframes blink { + to { + color: @foreground; + } +} + +#battery.warning { + color: @yellow; + animation-name: blink; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: normal; +} + +#battery.critical { + color: @red; + animation-name: blink; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: normal; +} + +#battery.charging { + color: @green; + animation-name: blink; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: normal; +} + +label:focus { + background-color: @selection; +} + +#temperature.critical { + color: @red; +} + +#idle_inhibitor.activated { + color: @green; +} diff --git a/home/terminal.nix b/home/terminal.nix new file mode 100644 index 0000000..409701b --- /dev/null +++ b/home/terminal.nix @@ -0,0 +1,75 @@ +{ config, pkgs, ... }: + +{ + imports = [ + ./kitty.nix + ./tmux.nix + ]; + + programs = { + atuin.enable = true; + bat = { + enable = true; + config = { + theme = "Dracula"; + }; + }; + btop = { + enable = true; + settings = { + color_theme = "dracula"; + vim_keys = true; + update_ms = 1000; + }; + }; + direnv = { + enable = true; + nix-direnv.enable = true; + }; + exa = { + enable = true; + enableAliases = true; + extraOptions = [ "--group-directories-first" "--group" ]; + git = true; + icons = true; + }; + starship = { + enable = true; + settings = { + add_newline = false; + git_metrics.disabled = false; + }; + }; + zsh = { + enable = true; + defaultKeymap = "viins"; + enableAutosuggestions = true; + enableCompletion = true; + enableSyntaxHighlighting = true; + history = { + expireDuplicatesFirst = true; + extended = true; + path = "${config.xdg.dataHome}/zsh/zsh_history"; + }; + initExtra = '' + bindkey -v '^?' backward-delete-char + ''; + profileExtra = '' + if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then + exec ${pkgs.sway}/bin/sway + fi + ''; + shellAliases = { + cat = "bat"; + cp = "cp -v"; + grep = "grep --color=auto"; + ln = "ln -v"; + mv = "mv -v"; + file = "nix run nixpkgs#file --"; + nurl = "nix run nixpkgs#nurl --"; + unzip = "nix run nixpkgs#unzip --"; + rebuild_system = "sudo nixos-rebuild --flake /persist/home/.nixos-config# --cores 0 --max-jobs 8"; + }; + }; + }; +} diff --git a/home/tmux.nix b/home/tmux.nix new file mode 100644 index 0000000..6c06749 --- /dev/null +++ b/home/tmux.nix @@ -0,0 +1,45 @@ +{ pkgs, ... }: + +{ + programs.tmux = { + enable = true; + shell = "${pkgs.zsh}/bin/zsh"; + escapeTime = 0; + plugins = with pkgs; [ + { + plugin = tmuxPlugins.dracula; + extraConfig = '' + set -g @dracula-show-powerline true + set -g @dracula-plugins "time" + set -g @dracula-show-timezone false + set -g @dracula-day-month true + set -g @dracula-show-flags true + set -g @dracula-show-left-icon session + ''; + } + ]; + extraConfig = '' + set -g update-environment 'DISPLAY TERM SWAYSOCK WAYLAND_DISPLAY' + if "[[ ''${TERM} =~ 256color || ''${TERM} == xterm-kitty || ''${TERM} == fbterm ]]" 'set -g default-terminal tmux-256color' + set -g allow-rename on + set -g set-titles on + set -g set-titles-string "#W" + set -g automatic-rename on + set -g automatic-rename-format '(#{b:pane_current_path}) #{pane_current_command}' + set -g status-position top + set -g status-interval 1 + set -g mouse on + + set -g monitor-activity on + set -g monitor-bell on + set -g visual-activity on + set -g visual-bell on + + set -g base-index 1 + setw -g pane-base-index 1 + + bind - split-window -v -c "#{pane_current_path}" + bind \\ split-window -h -c "#{pane_current_path}" + ''; + }; +} diff --git a/home/virt-manager.nix b/home/virt-manager.nix new file mode 100644 index 0000000..796023a --- /dev/null +++ b/home/virt-manager.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + home.packages = [ pkgs.virt-manager ]; + dconf.settings = { + "org/virt-manager/virt-manager/confirm" = { + "forcepoweroff" = false; + }; + "org/virt-manager/virt-manager/connections" = { + "autoconnect" = [ "qemu:///system" ]; + "uris" = [ "qemu:///system" ]; + }; + "org/virt-manager/virt-manager/new-vm" = { "firmware" = "uefi"; }; + "org/virt-manager/virt-manager/stats" = { + "enable-disk-poll" = true; + "enable-net-poll" = true; + }; + "org/virt-manager/virt-manager/vmlist-fields" = { "network-traffic" = true; }; + }; +} diff --git a/packages/adi1090x-plymouth/default.nix b/packages/adi1090x-plymouth/default.nix new file mode 100644 index 0000000..b8c31c1 --- /dev/null +++ b/packages/adi1090x-plymouth/default.nix @@ -0,0 +1,33 @@ +{ lib, stdenvNoCC, fetchFromGitHub, pack ? "pack_1", theme ? "cuts" }: + +stdenvNoCC.mkDerivation { + pname = "adi1090x-plymouth"; + version = "latest"; + + src = fetchFromGitHub { + owner = "adi1090x"; + repo = "plymouth-themes"; + rev = "bf2f570bee8e84c5c20caac353cbe1d811a4745f"; + sha256 = "sha256-VNGvA8ujwjpC2rTVZKrXni2GjfiZk7AgAn4ZB4Baj2k="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/plymouth/themes/ + cp -r ${pack}/${theme} $out/share/plymouth/themes/adi1090x + sed -i "s@\/usr\/@$out\/@" $out/share/plymouth/themes/adi1090x/${theme}.plymouth + mv $out/share/plymouth/themes/adi1090x/${theme}.plymouth $out/share/plymouth/themes/adi1090x/adi1090x.plymouth + sed -i 's/${theme}/adi1090x/g' $out/share/plymouth/themes/adi1090x/adi1090x.plymouth + mv $out/share/plymouth/themes/adi1090x/${theme}.script $out/share/plymouth/themes/adi1090x/adi1090x.script + + runHook postInstall + ''; + + meta = with lib; { + description = "A hugh collection (80+) of plymouth themes ported from android bootanimations"; + homepage = "https://github.com/adi1090x/plymouth-themes"; + license = licenses.gpl3; + platform = platforms.linux; + }; +} diff --git a/packages/catppuccin-wallpapers/default.nix b/packages/catppuccin-wallpapers/default.nix new file mode 100644 index 0000000..90016b2 --- /dev/null +++ b/packages/catppuccin-wallpapers/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenvNoCC, fetchFromGitHub }: + +stdenvNoCC.mkDerivation { + pname = "catppuccin-wallpapers"; + version = "latest"; + + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "wallpapers"; + rev = "0cea4a28451851a637762dec07ec4fb2bfebc421"; + hash = "sha256-B2ncT2qPc0inHHcO1BAZW5of+K0sIdtPcdpqcPUbKBo="; + }; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/wallpapers/catppuccin + find . -type f -regextype egrep -regex ".*\.(jpe?g|png)$" -exec cp {} $out/share/wallpapers/catppuccin/ \; + + runHook postInstall + ''; + + meta = with lib; { + description = "Wallpapers to match your Catppuccin setups!"; + homepage = "https://github.com/catppuccin/wallpapers"; + license = licenses.mit; + }; +} diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..788f9f6 --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,6 @@ +self: super: { + adi1090x-plymouth = super.callPackage ./adi1090x-plymouth { }; + catppuccin-wallpapers = super.callPackage ./catppuccin-wallpapers { }; + dracula-gtk = super.callPackage ./dracula-gtk { }; + newaita-icon-theme = super.callPackage ./newaita-icon-theme { }; +} diff --git a/packages/dracula-gtk/default.nix b/packages/dracula-gtk/default.nix new file mode 100644 index 0000000..6ac86c3 --- /dev/null +++ b/packages/dracula-gtk/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenvNoCC, fetchFromGitHub, gtk3, gnome-themes-extra, gtk-engine-murrine }: + +stdenvNoCC.mkDerivation { + pname = "dracula-gtk"; + version = "4.0"; + + src = fetchFromGitHub { + owner = "dracula"; + repo = "gtk"; + rev = "df9af5e1ded3d2e266bcd30b3d38ff74c9a1a7aa"; + hash = "sha256-2lmpEPYxdbRnKgcJ792cuzyOBmOIWhja18q+F3Pxgjs="; + }; + + nativeBuildInputs = [ gtk3 ]; + + buildInputs = [ + gnome-themes-extra + ]; + + propagatedUserEnvPkgs = [ gtk-engine-murrine ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/themes/Dracula + cp -ra assets cinnamon gnome-shell gtk-2.0 gtk-3.0 gtk-3.20 gtk-4.0 metacity-1 unity xfwm4 index.theme $out/share/themes/Dracula/ + + runHook postInstall + ''; + meta = with lib; { + description = "Dracula GTK theme"; + homepage = "https://draculatheme.com/gtk"; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/packages/newaita-icon-theme/default.nix b/packages/newaita-icon-theme/default.nix new file mode 100644 index 0000000..dae8b84 --- /dev/null +++ b/packages/newaita-icon-theme/default.nix @@ -0,0 +1,54 @@ +{ lib, stdenvNoCC, fetchFromGitHub, gtk3, gnome, gnome-icon-theme, hicolor-icon-theme, panel ? "dark", folder ? "default" }: + +stdenvNoCC.mkDerivation { + pname = "newaita-icon-theme"; + version = "latest"; + + src = fetchFromGitHub { + owner = "cbrnix"; + repo = "Newaita"; + rev = "c2b596b097a83be23833dc7bc40b5d07a63315e3"; + hash = "sha256-tqtjUy8RjvOu0NaK+iE0R1g7/eqCpmhbdxuNGd/YfSI="; + }; + + nativeBuildInputs = [ gtk3 ]; + + propagatedBuildInputs = [ + gnome.adwaita-icon-theme + gnome-icon-theme + hicolor-icon-theme + ]; + + dontDropIconThemeCache = true; + + installPhase = '' + runHook preInstall + + PANEL_DIR=".DP" + if [ "${panel}" != "dark" ]; then + PANEL_DIR=".LP" + fi + + FOLDER_DIR=".places-${folder}" + + mkdir -p $out/share/icons/Newaita{,-dark} + cp -ra Newaita/{actions,apps,categories,devices,emblems,mimetypes,status,icon-theme.cache,index.theme} $out/share/icons/Newaita/ + cp -ra Newaita-dark/{actions,apps,categories,devices,emblems,mimetypes,status,icon-theme.cache,index.theme} $out/share/icons/Newaita-dark/ + + cp -ra Newaita/''$PANEL_DIR $out/share/icons/Newaita/panel + cp -ra Newaita-dark/''$PANEL_DIR $out/share/icons/Newaita-dark/panel + + cp -ra Newaita/''$FOLDER_DIR $out/share/icons/Newaita/places + cp -ra Newaita-dark/''$FOLDER_DIR $out/share/icons/Newaita-dark/places + + runHook postInstall + ''; + + postFixup = "gtk-update-icon-cache $out/share/icons/Newaita{,-dark}"; + + meta = with lib; { + description = "Newaita icon theme"; + homepage = "https://github.com/cbrnix/Newaita"; + platforms = platforms.linux; + }; +} diff --git a/system/default.nix b/system/default.nix new file mode 100644 index 0000000..94d894e --- /dev/null +++ b/system/default.nix @@ -0,0 +1,86 @@ +{ lib, pkgs, ... }: { + + imports = [ + ./filesystem.nix + ./gnome-keyring.nix + ./gtk.nix + ./hardware.nix + ./packages.nix + ./persistence.nix + ./plymouth.nix + ./secureboot.nix + ./services.nix + ./swaylock.nix + ./virtualisation.nix + ]; + + boot = { + initrd.systemd.enable = true; + kernel.sysctl = { + "vm.swappiness" = 0; + }; + }; + + console.useXkbConfig = true; + + 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"; + LC_ALL = "en_US.UTF-8"; + }; + supportedLocales = [ "en_US.UTF-8/UTF-8" ]; + }; + + networking = { + hostName = "Skipper"; + networkmanager.enable = true; + useDHCP = lib.mkDefault false; + }; + + security = { + apparmor = { + enable = true; + enableCache = true; + }; + audit.enable = true; + auditd.enable = true; + polkit.enable = true; + rtkit.enable = true; + tpm2 = { + enable = true; + abrmd.enable = true; + pkcs11.enable = true; + tctiEnvironment.enable = true; + }; + sudo = { + package = pkgs.sudo.override { withInsults = true; }; + extraConfig = '' + Defaults lecture="never" + ''; + wheelNeedsPassword = true; + }; + }; + + sound.enable = true; + + time.timeZone = "Asia/Kolkata"; + + xdg = { + portal = { + enable = true; + wlr.enable = true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + }; + + system.stateVersion = "23.05"; +} diff --git a/system/disk.nix b/system/disk.nix new file mode 100644 index 0000000..f46ce43 --- /dev/null +++ b/system/disk.nix @@ -0,0 +1,15 @@ +{ ... }: { + boot = { + resumeDevice = "/dev/vg0/swap"; + initrd.luks.devices = { + luks0 = { + allowDiscards = true; + bypassWorkqueues = true; + device = "/dev/disk/by-partlabel/CRYPT"; + preLVM = true; + }; + }; + }; + + swapDevices = [{ device = "/dev/vg0/swap"; }]; +} diff --git a/system/filesystem.nix b/system/filesystem.nix new file mode 100644 index 0000000..f6919a9 --- /dev/null +++ b/system/filesystem.nix @@ -0,0 +1,32 @@ +{ ... }: { + boot.tmpOnTmpfs = true; + fileSystems = { + "/" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "defaults" "uid=0" "gid=0" "mode=0755" ]; + neededForBoot = true; + }; + "/nix" = { + device = "/dev/vg0/system"; + fsType = "btrfs"; + options = [ "subvol=/@nix" "compress-force=zstd" ]; + neededForBoot = true; + }; + "/persist" = { + device = "/dev/vg0/system"; + fsType = "btrfs"; + options = [ "subvol=/@persist" "compress-force=zstd" ]; + neededForBoot = true; + }; + "/mnt/system" = { + device = "/dev/vg0/system"; + fsType = "btrfs"; + options = [ "subvol=/" "compress-force=zstd" ]; + }; + "/boot" = { + device = "/dev/disk/by-partlabel/ESP"; + fsType = "vfat"; + }; + }; +} diff --git a/system/gnome-keyring.nix b/system/gnome-keyring.nix new file mode 100644 index 0000000..046e23b --- /dev/null +++ b/system/gnome-keyring.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + programs.seahorse.enable = true; + services.gnome.gnome-keyring.enable = true; + security.pam.services.passwd.enableGnomeKeyring = true; + security.pam.services.login.enableGnomeKeyring = true; +} diff --git a/system/gtk.nix b/system/gtk.nix new file mode 100644 index 0000000..0dd1639 --- /dev/null +++ b/system/gtk.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + programs.dconf.enable = true; +} diff --git a/system/hardware.nix b/system/hardware.nix new file mode 100644 index 0000000..01e30e6 --- /dev/null +++ b/system/hardware.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, config, ... }: { + + imports = [ ./disk.nix ./kernel.nix ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + hardware.opengl = { + enable = true; + extraPackages = [ pkgs.intel-media-driver ]; + driSupport = true; + }; + + hardware = { + cpu.intel.updateMicrocode = lib.mkDefault true; + enableRedistributableFirmware = true; + }; + + hardware.bluetooth.enable = true; + + hardware.sensor.hddtemp = { + enable = true; + drives = [ "/dev/disk/by-path/pci-0000:01:00.0-nvme-1" ]; + }; + + boot.loader = { + efi.canTouchEfiVariables = true; + }; +} diff --git a/system/kernel.nix b/system/kernel.nix new file mode 100644 index 0000000..aff05b9 --- /dev/null +++ b/system/kernel.nix @@ -0,0 +1,21 @@ +{ lib, pkgs, ... }: { + + boot = { + initrd = { + availableKernelModules = [ + "xhci_pci" + "thunderbolt" + "vmd" + "nvme" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + kernelModules = [ "i915" ]; + }; + kernelModules = [ "kvm-intel" ]; + kernelPackages = pkgs.linuxPackages_zen; + }; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/system/nix.nix b/system/nix.nix new file mode 100644 index 0000000..868b279 --- /dev/null +++ b/system/nix.nix @@ -0,0 +1,15 @@ +{ ... }: { + nix.settings = { + substituters = [ + "https://devenv.cachix.org" + "https://nix-community.cachix.org/" + ]; + trusted-public-keys = [ + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + auto-optimise-store = true; + experimental-features = [ "nix-command" "flakes" ]; + }; + nixpkgs.config.allowUnfree = true; +} diff --git a/system/packages.nix b/system/packages.nix new file mode 100644 index 0000000..648fbec --- /dev/null +++ b/system/packages.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: { + + fonts.fonts = with pkgs; [ + cantarell-fonts + liberation_ttf + (nerdfonts.override { fonts = [ "FiraCode" ]; }) + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + ]; + + programs = { + git.enable = true; + neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; + xwayland.enable = true; + zsh.enable = true; + }; + environment.pathsToLink = [ "/share/zsh" ]; +} diff --git a/system/persistence.nix b/system/persistence.nix new file mode 100644 index 0000000..ff3f6e1 --- /dev/null +++ b/system/persistence.nix @@ -0,0 +1,23 @@ +{ ... }: +{ + environment.persistence."/persist/system" = { + hideMounts = true; + directories = [ + "/etc/NetworkManager/system-connections" + "/etc/secureboot" + "/root/.cache/nix" + "/var/cache/apparmor" + "/var/lib/bluetooth" + "/var/lib/docker" + "/var/lib/libvirt" + "/var/lib/NetworkManager" + "/var/lib/nixos" + "/var/lib/systemd" + "/var/log" + ]; + files = [ + "/etc/machine-id" + "/var/lib/logrotate.status" + ]; + }; +} diff --git a/system/plymouth.nix b/system/plymouth.nix new file mode 100644 index 0000000..1f4695c --- /dev/null +++ b/system/plymouth.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + + boot.consoleLogLevel = 3; + boot.kernelParams = [ "quiet" ]; + boot.plymouth = { + enable = true; + themePackages = [ (pkgs.adi1090x-plymouth.override { pack = "pack_3"; theme = "owl"; }) ]; + theme = "adi1090x"; + }; +} diff --git a/system/secureboot.nix b/system/secureboot.nix new file mode 100644 index 0000000..c173c31 --- /dev/null +++ b/system/secureboot.nix @@ -0,0 +1,12 @@ +{ lib, pkgs, ... }: +{ + boot.bootspec.enable = true; + boot.loader.systemd-boot.enable = lib.mkForce false; + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + environment.systemPackages = with pkgs; [ + sbctl + ]; +} diff --git a/system/services.nix b/system/services.nix new file mode 100644 index 0000000..08ae76a --- /dev/null +++ b/system/services.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: { + services = { + blueman.enable = true; + dbus = { + enable = true; + apparmor = "enabled"; + packages = [ pkgs.gcr pkgs.gcr_4 ]; + }; + fstrim.enable = true; + fwupd.enable = true; + gvfs.enable = true; + lvm.dmeventd.enable = true; + pipewire = { + enable = true; + alsa.enable = true; + jack.enable = true; + pulse.enable = true; + }; + power-profiles-daemon.enable = true; + thermald.enable = true; + udisks2.enable = true; + }; +} diff --git a/system/swaylock.nix b/system/swaylock.nix new file mode 100644 index 0000000..98d2b8b --- /dev/null +++ b/system/swaylock.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + security.pam.services.swaylock = { }; +} diff --git a/system/virtualisation.nix b/system/virtualisation.nix new file mode 100644 index 0000000..1c572c2 --- /dev/null +++ b/system/virtualisation.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: { + virtualisation = { + docker.enable = true; + kvmgt.enable = true; + libvirtd = { + enable = true; + qemu.ovmf = { + enable = true; + packages = [ pkgs.OVMFFull.fd ]; + }; + }; + }; +} diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..257aab1 --- /dev/null +++ b/users/default.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +let + user = import ./user.nix; +in +{ + services.getty.autologinUser = user.primary.userName; + users.mutableUsers = false; + users.users = { + root.hashedPassword = user.root.hashedPassword; + "${user.primary.userName}" = { + uid = 1000; + hashedPassword = user.primary.hashedPassword; + description = user.primary.realName; + isNormalUser = true; + extraGroups = [ "docker" "libvirtd" "networkmanager" "tss" "wheel" ]; + shell = pkgs.zsh; + }; + }; +} diff --git a/users/user.nix b/users/user.nix new file mode 100644 index 0000000000000000000000000000000000000000..27819b24b438c041937629545c39fa61d826707d GIT binary patch literal 464 zcmV;>0WbalM@dveQdv+`0Ap|S6@m4PmJ@{eRFn~klcrK(jOCor%9osRNv(DRPhsy| zKGQc10fPi60fO7Xhu1Lr`da9>DoE6?8fjO*Xu&FCv;>?|0>uWmdJT(X&Y#`BRXs#5 zr!HPA*SJ#5=cbpy#}=Z~I*qeSnilg7Z0n2z6zw-rF;HuIH-UW5!QQ?g19on9d_1~O*$oElIh&HPq zAz4+833Yhbx&utZ31A+GM8aoMFRZ#Nwgtj!G~kk!^1n$ag*gH`i7|*tP5Pb{vsI#M z=h)7sVbA}vdCEVb{F|*@)f6Hwa`)$MfLN(AmrK#Yc|wpR5LZ{1{wpIQ@S;U3OH@^D zQ(|NCLlJ^qtqDlK-79!?v1olz<(;4oc@$AA-3Vf>UlYFRBMHQ%2`1L8P@#+@aRDHB zlDAR{5LY*ieVM^u