diff --git a/.gitattributes b/.gitattributes index 2f4eec3..95d2ba0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -home-manager/secrets/* filter=git-crypt diff=git-crypt +shared/secrets/* filter=git-crypt diff=git-crypt diff --git a/README.md b/README.md index 90098e9..cd278b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # NixOS Configurations -My NixOS configurations with dotfiles for my desktop +My NixOS configurations with dotfiles for my systems. ![Screenshot of desktop](./.gitea/assets/desktop.png) diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index 73c5636..0000000 --- a/configuration.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ - pkgs, - inputs, - outputs, - common, - ... -}: - -{ - imports = [ ./modules ]; - - nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; - - # Bootloader. - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - - # Define a user account. Don't forget to set a password with 'passwd'. - users.users.${common.username} = { - isNormalUser = true; - description = common.username; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - environment.sessionVariables = { - # Tells Electron apps to use Wayland - NIXOS_OZONE_WL = "1"; - }; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - xdg-utils - xdg-desktop-portal - xdg-desktop-portal-gtk - unstable.protonmail-desktop - stremio - fastfetch - discord - nix-prefetch-github # Cmd to get rev and hash from GitHub - gimp - vlc - vdhcoapp # TODO run "vdhcoapp install" on startup - onlyoffice-desktopeditors - inputs.grayjay.packages.${pkgs.system}.grayjay - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - programs.kdeconnect.enable = true; - - services = { - flatpak.enable = false; - xserver.enable = true; - }; - - system.stateVersion = common.system.version; -} diff --git a/flake.lock b/flake.lock index a360bc3..d3eca85 100644 --- a/flake.lock +++ b/flake.lock @@ -3,7 +3,10 @@ "ags": { "inputs": { "astal": "astal", - "nixpkgs": ["hyprpanel", "nixpkgs"] + "nixpkgs": [ + "hyprpanel", + "nixpkgs" + ] }, "locked": { "lastModified": 1736090999, @@ -21,7 +24,11 @@ }, "astal": { "inputs": { - "nixpkgs": ["hyprpanel", "ags", "nixpkgs"] + "nixpkgs": [ + "hyprpanel", + "ags", + "nixpkgs" + ] }, "locked": { "lastModified": 1735172721, @@ -42,11 +49,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1743414153, - "narHash": "sha256-bFIXz7SvLlSNR4M3vYPYS1CpEN9vTUiH01R4iR/BDmA=", + "lastModified": 1744447794, + "narHash": "sha256-z5uK5BDmFg0L/0EW2XYLGr39FbQeXyNVnIEhkZrG8+Q=", "owner": "catppuccin", "repo": "nix", - "rev": "2f52f9ead26f80d7b391cedcbb3eb309bd83fff4", + "rev": "c44fe73ed8e5d5809eded7cc6156ca9c40044e42", "type": "github" }, "original": { @@ -55,9 +62,47 @@ "type": "github" } }, + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "owner": "numtide", + "repo": "devshell", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "flake-parts": { "inputs": { - "nixpkgs-lib": ["nixvim", "nixpkgs"] + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] }, "locked": { "lastModified": 1743550720, @@ -91,16 +136,64 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "grayjay": { "inputs": { "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1743563044, - "narHash": "sha256-UkykPaJt9Yr8YbBg34Bnh4wE+J2sksSDFdaalfnkG6k=", + "lastModified": 1744375210, + "narHash": "sha256-aMnp0e+oGmsZ+VC6mgrE6lUcKMjBPotLesCosejRhdw=", "owner": "rishabh5321", "repo": "grayjay-flake", - "rev": "82a651064b00480042d1b7f180ca77e04ea08689", + "rev": "ab754473aecde1afad07ab5a5903c9336bcb5442", "type": "github" }, "original": { @@ -111,14 +204,16 @@ }, "home-manager": { "inputs": { - "nixpkgs": ["nixpkgs"] + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1743387206, - "narHash": "sha256-24N3NAuZZbYqZ39NgToZgHUw6M7xHrtrAm18kv0+2Wo=", + "lastModified": 1744117652, + "narHash": "sha256-t7dFCDl4vIOOUMhEZnJF15aAzkpaup9x4ZRGToDFYWI=", "owner": "nix-community", "repo": "home-manager", - "rev": "15c5f9d04fabd176f30286c8f52bbdb2c853a146", + "rev": "b4e98224ad1336751a2ac7493967a4c9f6d9cb3f", "type": "github" }, "original": { @@ -128,17 +223,60 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743808813, + "narHash": "sha256-2lDQBOmlz9ggPxcS7/GvcVdzXMIiT+PpMao6FbLJSr0=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "a9f8b3db211b4609ddd83683f9db89796c7f6ac6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-24.11", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743604125, + "narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "hyprpanel": { "inputs": { "ags": "ags", "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1740863579, - "narHash": "sha256-U4amsszfgPUTAa9FrIlYsCCpmAyko22h/nbjhmAZvAs=", + "lastModified": 1744259355, + "narHash": "sha256-gykRJw309t5NLuYXzWw9WhJFKTc4OASmc16M9jD/Vpw=", "owner": "Jas-SinghFSU", "repo": "HyprPanel", - "rev": "2be9f1ef6c2df2ecf0eebe5a039e8029d8d151cd", + "rev": "1d4d2dcc20ebd707d5e45c7e357acc1267a498d7", "type": "github" }, "original": { @@ -149,8 +287,16 @@ }, "ixx": { "inputs": { - "flake-utils": ["nixvim", "nuschtosSearch", "flake-utils"], - "nixpkgs": ["nixvim", "nuschtosSearch", "nixpkgs"] + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] }, "locked": { "lastModified": 1729958008, @@ -167,13 +313,35 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743127615, + "narHash": "sha256-+sMGqywrSr50BGMLMeY789mSrzjkoxZiu61eWjYS/8o=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "fc843893cecc1838a59713ee3e50e9e7edc6207c", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "nix-darwin-24.11", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1742889210, - "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "lastModified": 1744098102, + "narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "type": "github" }, "original": { @@ -183,17 +351,33 @@ "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-stable": { "locked": { - "lastModified": 1743448293, - "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", - "owner": "nixos", + "lastModified": 1744309437, + "narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", + "rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1744232761, + "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", + "type": "github" + }, + "original": { + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -201,11 +385,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1743448293, - "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", + "lastModified": 1744232761, + "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", + "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", "type": "github" }, "original": { @@ -233,15 +417,15 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1743501102, - "narHash": "sha256-7PCBQ4aGVF8OrzMkzqtYSKyoQuU2jtpPi4lmABpe5X4=", - "owner": "nixos", + "lastModified": 1744309437, + "narHash": "sha256-QZnNHM823am8apCqKSPdtnzPGTy2ZB4zIXOVoBp5+W0=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "02f2af8c8a8c3b2c05028936a1e84daefa1171d4", + "rev": "f9ebe33a928b5d529c895202263a5ce46bdf12f7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" @@ -249,11 +433,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1742288794, - "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", + "lastModified": 1743448293, + "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", + "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", "type": "github" }, "original": { @@ -265,20 +449,29 @@ }, "nixvim": { "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "nixpkgs": ["nixpkgs-unstable"], - "nuschtosSearch": "nuschtosSearch" + "git-hooks": "git-hooks", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1743598191, - "narHash": "sha256-30aI8rWjX64E9vIlE4iqgQguTjItvTnQLTqHtFppF/w=", + "lastModified": 1743856924, + "narHash": "sha256-CgCbUGd9y639PfcuzA0TrA6O5N1ICl+mB95+qTG52+E=", "owner": "nix-community", "repo": "nixvim", - "rev": "a183298bf67307bdb7a25a2a3c565e76029f1b9e", + "rev": "d209a04d349febe85c777078ca2eeea5e8bbc8a1", "type": "github" }, "original": { "owner": "nix-community", + "ref": "nixos-24.11", "repo": "nixvim", "type": "github" } @@ -287,14 +480,17 @@ "inputs": { "flake-utils": "flake-utils", "ixx": "ixx", - "nixpkgs": ["nixvim", "nixpkgs"] + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1743201766, - "narHash": "sha256-bb/dqoIjtIWtJRzASOe8g4m8W2jUIWtuoGPXdNjM/Tk=", + "lastModified": 1743683223, + "narHash": "sha256-LdXtHFvhEC3S64dphap1pkkzwjErbW65eH1VRerCUT0=", "owner": "NuschtOS", "repo": "search", - "rev": "2651dbfad93d6ef66c440cbbf23238938b187bde", + "rev": "56a49ffef2908dad1e9a8adef1f18802bc760962", "type": "github" }, "original": { @@ -310,6 +506,7 @@ "home-manager": "home-manager", "hyprpanel": "hyprpanel", "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", "nixvim": "nixvim", "spicetify-nix": "spicetify-nix", @@ -318,15 +515,17 @@ }, "spicetify-nix": { "inputs": { - "nixpkgs": ["nixpkgs"], + "nixpkgs": [ + "nixpkgs-unstable" + ], "systems": "systems_2" }, "locked": { - "lastModified": 1743595372, - "narHash": "sha256-e3x1mhpPpYgyyin9j/VbrBpOT5PFpEfx2hkxVZuJZhg=", + "lastModified": 1744423915, + "narHash": "sha256-6Hd8VyrOlmjlDBgPpx9NwX4+/uO4gEDIyjqbQLyniwE=", "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "543f12dd14c62ddee79ab79fbfd8726f312b89ff", + "rev": "4c4b9611c71d586ea818fa5b8dcbd81129f62560", "type": "github" }, "original": { @@ -365,16 +564,38 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743748085, + "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "zen-browser": { "inputs": { + "home-manager": "home-manager_3", "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1743600524, - "narHash": "sha256-ZJesdL2jwCwBF4SsWvxNyGuHUv8cGLHIQwJxma6JQR0=", + "lastModified": 1744406237, + "narHash": "sha256-Xbt5m3/ZNeye4b42rCZOLbD8OhCOeJfUSEJ+FvfXwpg=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "9818e303273448dde6ada0f7bff8b98f5ce261da", + "rev": "4d9ee0daab52a7a205e69cfddcd441ffaa09c802", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 51aeef2..c6602de 100644 --- a/flake.nix +++ b/flake.nix @@ -1,99 +1,191 @@ { - description = "NixOS configuration"; + description = "Martin's NixOS configuration - Based on EmergentMind/nix-config"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # + # ========= Official NixOS and HM Package Sources ========= + # + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + # The next two are for pinning to stable vs unstable regardless of what the above is set to + # This is particularly useful when an upcoming stable release is in beta because you can effectively + # keep 'nixpkgs-stable' set to stable for critical packages while setting 'nixpkgs' to the beta branch to + # get a jump start on deprecation changes. + # See also 'stable-packages' and 'unstable-packages' overlays at 'overlays/default.nix" + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; - catppuccin = { - url = "github:catppuccin/nix"; - }; home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; - hyprpanel = { - url = "github:Jas-SinghFSU/HyprPanel"; + + # + # ========= Utilities ========= + # + # Secrets management + # sops-nix = { + # url = "github:mic92/sops-nix"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + # Catppuccin theming + catppuccin = { + url = "github:catppuccin/nix"; }; + # vim nixvim = { - url = "github:nix-community/nixvim"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; - }; - spicetify-nix = { - url = "github:Gerg-L/spicetify-nix"; + url = "github:nix-community/nixvim/nixos-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + # Bar + hyprpanel.url = "github:Jas-SinghFSU/HyprPanel"; + # Spotify + spicetify-nix = { + url = "github:Gerg-L/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + # Browser zen-browser.url = "github:0xc000022070/zen-browser-flake"; + # Video aggregator grayjay.url = "github:rishabh5321/grayjay-flake"; }; outputs = - inputs@{ - self, # Get a ref to outputs + { + self, nixpkgs, - nixpkgs-unstable, home-manager, ... - }: + }@inputs: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; inherit (self) outputs; - common = import ./common.nix; - theme = import ./theme.nix; + common = import ./shared/common.nix; + theme = import ./shared/theme.nix; + + # + # ========= Architectures ========= + # + forAllSystems = nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + ]; + + # ========== Extend lib with lib.custom ========== + # NOTE: This approach allows lib.custom to propagate into hm + # see: https://github.com/nix-community/home-manager/pull/3454 + customLib = (_self: _super: { custom = import ./lib { inherit (nixpkgs) lib; }; }); + lib = nixpkgs.lib.extend customLib; + libHm = home-manager.lib.extend customLib; + + systems = builtins.map (config: defaultAttrs // config) [ + { + hostName = "desktop"; + system = "x86_64-linux"; + nvidia.enable = true; + } + { + hostName = "thinkpad"; + system = "x86_64-linux"; + } + { + hostName = "pi4"; + system = "aarch64-linux"; + wayland.enable = false; + } + # TODO Homelab config + ]; + + defaultAttrs = { + user = { + name = common.username; + password = "temp"; + }; + version = common.system.version; + wayland.enable = true; + nvidia.enable = false; + }; + in { - defaultPackage.${system} = home-manager.defaultPackage.${system}; + # + # ========= Overlays ========= + # + # Custom modifications/overrides to upstream packages + overlays = import ./overlays.nix { inherit inputs; }; - # The minimum amount of dependencies in order to run 'just switch-now' - devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ - just - git - git-crypt - nh - ]; - }; - - # Adds the nix fmt command to format nix files - formatter.${system} = pkgs.nixfmt-rfc-style; - - nixosConfigurations.${common.hostname} = nixpkgs.lib.nixosSystem { - system = system; - specialArgs = { - inherit - outputs - inputs - common - theme - ; - }; # Pass args to modules - modules = [ - ./configuration.nix - home-manager.nixosModules.home-manager + # + # ========= Host Configurations ========= + # + nixosConfigurations = builtins.listToAttrs ( + builtins.map ( { - home-manager = { - # Backups conflicting files in case of error - backupFileExtension = "bkp"; - useGlobalPkgs = true; - useUserPackages = true; - # Passes inputs as an argument to home-manager - extraSpecialArgs = { inherit inputs common theme; }; - users.${common.username} = import ./home-manager; + hostName, + system, + user, + ... + }@systemConfig: + + { + name = hostName; + value = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit + outputs + inputs + common + theme + lib + systemConfig + ; + isDarwin = false; + }; + modules = [ + ./hosts/${hostName} + home-manager.nixosModules.home-manager + { + home-manager = { + # Backups conflicting files in case of error + backupFileExtension = "bkp"; + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit + inputs + common + theme + libHm + systemConfig + ; + }; + users.${user.name} = import ./hosts/${hostName}/home-manager; + }; + } + { + nixpkgs.overlays = with inputs; [ + hyprpanel.overlay + ]; + } + ]; }; } - ./overlays.nix - ]; - }; + ) systems + ); - overlays = { - # Gives access to unstable packages everywhere - unstable-packages = final: _prev: { - unstable = import nixpkgs-unstable { - system = final.system; - config.allowUnfree = true; - }; - }; - }; + # + # ========= Formatting ========= + # + # Nix formatter available through 'nix fmt' https://github.com/NixOS/nixfmt + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style); + + # + # ========= DevShell ========= + # + # Custom shell for bootstrapping on new hosts, modifying nix-config, and secrets management + devShells = forAllSystems ( + system: + import ./shell.nix { + pkgs = nixpkgs.legacyPackages.${system}; + } + ); }; } diff --git a/home-manager/hyprland/swaync/default.nix b/home-manager/hyprland/swaync/default.nix deleted file mode 100644 index 49986b8..0000000 --- a/home-manager/hyprland/swaync/default.nix +++ /dev/null @@ -1,461 +0,0 @@ -{ lib, theme, ... }: - -{ - services.swaync = { - enable = false; - style = lib.mkDefault '' - * { - all: unset; - font-size: 14px; - font-family: "${theme.nerdFont} Nerd Font", monospace; - transition: 200ms; - } - - trough highlight { - background: #${theme.textAlpha}; - } - - scale trough { - margin: 0 1rem; - background-color: #${theme.surface0Alpha}; - min-height: 8px; - min-width: 70px; - } - - slider { - background-color: #${theme.blueAlpha}; - } - - .floating-notifications.background .notification-row .notification-background { - box-shadow: - 0 0 8px 0 rgba(0, 0, 0, 0.8), - inset 0 0 0 1px #${theme.surface0Alpha}; - border-radius: 12.6px; - margin: 18px; - background-color: #${theme.baseAlpha}; - color: #${theme.textAlpha}; - padding: 0; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification { - padding: 7px; - border-radius: 12.6px; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification.critical { - box-shadow: inset 0 0 7px 0 #${theme.redAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content { - margin: 7px; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .summary { - color: #${theme.textAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .time { - color: #${theme.subtext0Alpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - .notification-content - .body { - color: #${theme.textAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * { - min-height: 3.4em; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action { - border-radius: 7px; - color: #${theme.textAlpha}; - background-color: #${theme.surface0Alpha}; - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - margin: 7px; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:hover { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.surface0Alpha}; - color: #${theme.textAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:active { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.sapphireAlpha}; - color: #${theme.textAlpha}; - } - - /* Close Button */ - .floating-notifications.background - .notification-row - .notification-background - .close-button { - margin: 7px; - padding: 2px; - border-radius: 6.3px; - color: #${theme.baseAlpha}; - background-color: #${theme.redAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .close-button:hover { - background-color: #${theme.maroonAlpha}; - color: #${theme.baseAlpha}; - } - - .floating-notifications.background - .notification-row - .notification-background - .close-button:active { - background-color: #${theme.redAlpha}; - color: #${theme.baseAlpha}; - } - - .control-center { - box-shadow: - 0 0 8px 0 rgba(0, 0, 0, 0.8), - inset 0 0 0 1px #${theme.surface0Alpha}; - border-radius: 12.6px; - margin: 18px; - background-color: #${theme.baseAlpha}; - color: #${theme.textAlpha}; - padding: 14px; - } - - .control-center .widget-title > label { - color: #${theme.textAlpha}; - font-size: 1.3em; - } - - .control-center .widget-title button { - border-radius: 7px; - color: #${theme.textAlpha}; - background-color: #${theme.surface0Alpha}; - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - padding: 8px; - } - - .control-center .widget-title button:hover { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #585b70; - color: #${theme.textAlpha}; - } - - .control-center .widget-title button:active { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.sapphireAlpha}; - color: #${theme.baseAlpha}; - } - - .control-center .notification-row .notification-background { - border-radius: 7px; - color: #${theme.textAlpha}; - background-color: #${theme.surface0Alpha}; - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - margin-top: 14px; - } - - .control-center .notification-row .notification-background .notification { - padding: 7px; - border-radius: 7px; - } - - .control-center - .notification-row - .notification-background - .notification.critical { - box-shadow: inset 0 0 7px 0 #${theme.redAlpha}; - } - - .control-center - .notification-row - .notification-background - .notification - .notification-content { - margin: 7px; - } - - .control-center - .notification-row - .notification-background - .notification - .notification-content - .summary { - color: #${theme.textAlpha}; - } - - .control-center - .notification-row - .notification-background - .notification - .notification-content - .time { - color: #a6adc8; - } - - .control-center - .notification-row - .notification-background - .notification - .notification-content - .body { - color: #${theme.textAlpha}; - } - - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * { - min-height: 3.4em; - } - - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action { - border-radius: 7px; - color: #${theme.textAlpha}; - background-color: #${theme.crustAlpha}; - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - margin: 7px; - } - - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:hover { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.surface0Alpha}; - color: #${theme.textAlpha}; - } - - .control-center - .notification-row - .notification-background - .notification - > *:last-child - > * - .notification-action:active { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.sapphireAlpha}; - color: #${theme.textAlpha}; - } - - .control-center .notification-row .notification-background .close-button { - margin: 7px; - padding: 2px; - border-radius: 6.3px; - color: #${theme.baseAlpha}; - background-color: #${theme.maroonAlpha}; - } - - .close-button { - border-radius: 6.3px; - } - - .control-center .notification-row .notification-background .close-button:hover { - background-color: #${theme.redAlpha}; - color: #${theme.baseAlpha}; - } - - .control-center - .notification-row - .notification-background - .close-button:active { - background-color: #${theme.redAlpha}; - color: #${theme.baseAlpha}; - } - - .control-center .notification-row .notification-background:hover { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.overlay1Alpha}; - color: #${theme.textAlpha}; - } - - .control-center .notification-row .notification-background:active { - box-shadow: inset 0 0 0 1px #${theme.surface1Alpha}; - background-color: #${theme.sapphireAlpha}; - color: #${theme.textAlpha}; - } - - .notification.critical progress { - background-color: #${theme.redAlpha}; - } - - .notification.low progress, - .notification.normal progress { - background-color: #${theme.blueAlpha}; - } - - .control-center-dnd { - margin-top: 5px; - border-radius: 8px; - background: #${theme.surface0Alpha}; - border: 1px solid #${theme.surface1Alpha}; - box-shadow: none; - } - - .control-center-dnd:checked { - background: #${theme.surface0Alpha}; - } - - .control-center-dnd slider { - background: #${theme.surface1Alpha}; - border-radius: 8px; - } - - .widget-dnd { - margin: 0px; - font-size: 1.1rem; - } - - .widget-dnd > switch { - font-size: initial; - border-radius: 8px; - background: #${theme.surface0Alpha}; - border: 1px solid #${theme.surface1Alpha}; - box-shadow: none; - } - - .widget-dnd > switch:checked { - background: #${theme.surface0Alpha}; - } - - .widget-dnd > switch slider { - background: #${theme.surface1Alpha}; - border-radius: 8px; - border: 1px solid #${theme.overlay0Alpha}; - } - - .widget-mpris .widget-mpris-player { - background: #${theme.surface0Alpha}; - padding: 7px; - } - - .widget-mpris .widget-mpris-title { - font-size: 1.2rem; - } - - .widget-mpris .widget-mpris-subtitle { - font-size: 0.8rem; - } - - .widget-menubar > box > .menu-button-bar > button > label { - font-size: 3rem; - padding: 0.5rem 2rem; - } - - .widget-menubar > box > .menu-button-bar > :last-child { - color: #${theme.redAlpha}; - } - - .power-buttons button:hover, - .powermode-buttons button:hover, - .screenshot-buttons button:hover { - background: #${theme.surface0Alpha}; - } - - .control-center .widget-label > label { - color: #${theme.textAlpha}; - font-size: 2rem; - } - - .widget-buttons-grid { - padding-top: 1rem; - } - - .widget-buttons-grid > flowbox > flowboxchild > button label { - font-size: 2.5rem; - } - - .widget-volume { - padding-top: 1rem; - } - - .widget-volume label { - font-size: 1.5rem; - color: #${theme.sapphireAlpha}; - } - - .widget-volume trough highlight { - background: #${theme.sapphireAlpha}; - } - - .widget-backlight trough highlight { - background: #${theme.yellowAlpha}; - } - - .widget-backlight label { - font-size: 1.5rem; - color: #${theme.yellowAlpha}; - } - - .widget-backlight .KB { - padding-bottom: 1rem; - } - - .image { - padding-right: 0.5rem; - } - ''; - }; -} diff --git a/home-manager/hyprland/waybar/config/config.jsonc b/home-manager/hyprland/waybar/config/config.jsonc deleted file mode 100644 index 8c09f42..0000000 --- a/home-manager/hyprland/waybar/config/config.jsonc +++ /dev/null @@ -1,108 +0,0 @@ -{ - "layer": "top", - // Waybar at top layer - "position": "top", - // Waybar position (top|bottom|left|right) - // "width": 1280, // Waybar width - // Choose the order of the modules - "modules-left": ["hyprland/workspaces", "custom/music"], - "modules-center": ["hyprland/window"], - "modules-right": [ - "hyprland/language", - "wireplumber", - "backlight", - "clock", - "custom/notification", - "tray", - "custom/lock", - "custom/power" - ], - "hyprland/workspaces": { - "disable-scroll": false, - "sort-by-name": true, - "format": " {id} " - }, - "hyprland/window": { - "format": "{initialTitle}" - }, - "tray": { - "icon-size": 21, - "spacing": 10 - }, - // TODO better music module - "custom/music": { - "format": "󰓃 {}", - "escape": true, - "interval": 5, - "tooltip": false, - "exec": "playerctl metadata --format='{{ title }}'", - "on-click": "playerctl play-pause", - "max-length": 50 - }, - "clock": { - "timezone": "Europe/Oslo", - "tooltip-format": "{:%Y %B}\n{calendar}", - "format": " {:%H:%M  %d/%m}", - "calendar": { - "mode": "month", - "weeks-pos": "left", - "format": { - "months": "{}", - "days": "{}", - "weeks": "W{}", - "weekdays": "{}", - "today": "{}" - } - } - }, - "backlight": { - "device": "intel_backlight", - "format": "{icon}", - "format-icons": ["", "", "", "", "", "", "", "", ""] - }, - "wireplumber": { - // "scroll-step": 1, // %, can be a float - "format": "{icon} {volume}%", - "format-muted": " ", - "format-icons": { - "default": ["", " ", " "] - }, - "on-click": "pavucontrol" - }, - "hyprland/language": { - "format-en": "EN", - "format-no": "NO", - "keyboard-name": "logitech-logitech-g710-keyboard", - "on-click": "hyprctl switchxkblayout logitech-logitech-g710-keyboard next" - }, - "custom/lock": { - "tooltip": false, - "on-click": "sh -c '(sleep 0.5s; hyprlock)'", - "format": "" - }, - "custom/power": { - "tooltip": false, - "on-click": "wlogout &", - "format": " " - }, - "custom/notification": { - "tooltip": false, - "format": "{icon}", - "format-icons": { - "notification": "", - "none": "", - "dnd-notification": "", - "dnd-none": "", - "inhibited-notification": "", - "inhibited-none": "", - "dnd-inhibited-notification": "", - "dnd-inhibited-none": "" - }, - "return-type": "json", - "exec-if": "which swaync-client", - "exec": "swaync-client -swb", - "on-click": "swaync-client -t -sw", - "on-click-right": "swaync-client -d -sw", - "escape": true - } -} diff --git a/home-manager/hyprland/waybar/config/mocha.css b/home-manager/hyprland/waybar/config/mocha.css deleted file mode 100644 index 98e218a..0000000 --- a/home-manager/hyprland/waybar/config/mocha.css +++ /dev/null @@ -1,37 +0,0 @@ -/* -* -* Catppuccin Mocha palette -* Maintainer: rubyowo -* -*/ - -@define-color base #1e1e2e; -@define-color mantle #181825; -@define-color crust #11111b; - -@define-color text #cdd6f4; -@define-color subtext0 #a6adc8; -@define-color subtext1 #bac2de; - -@define-color surface0 #313244; -@define-color surface1 #45475a; -@define-color surface2 #585b70; - -@define-color overlay0 #6c7086; -@define-color overlay1 #7f849c; -@define-color overlay2 #9399b2; - -@define-color blue #89b4fa; -@define-color lavender #b4befe; -@define-color sapphire #74c7ec; -@define-color sky #89dceb; -@define-color teal #94e2d5; -@define-color green #a6e3a1; -@define-color yellow #f9e2af; -@define-color peach #fab387; -@define-color maroon #eba0ac; -@define-color red #f38ba8; -@define-color mauve #cba6f7; -@define-color pink #f5c2e7; -@define-color flamingo #f2cdcd; -@define-color rosewater #f5e0dc; diff --git a/home-manager/hyprland/waybar/config/style.css b/home-manager/hyprland/waybar/config/style.css deleted file mode 100644 index 77d2de3..0000000 --- a/home-manager/hyprland/waybar/config/style.css +++ /dev/null @@ -1,104 +0,0 @@ -@import "mocha.css"; - -* { - font-family: JetBrainsMono Nerd Font; - font-size: 15px; - min-height: 0; -} - -#waybar { - background: transparent; - color: @text; - margin: 5px 5px; -} - -#workspaces { - border-radius: 1rem; - background-color: @surface0; - margin: 5px 5px 5px 1rem; -} - -#workspaces button { - color: @lavender; - border-radius: 1rem; - padding: 0.4rem; -} - -#workspaces button.active { - color: @sky; - border-radius: 1rem; -} - -#workspaces button:hover { - color: @sapphire; - border-radius: 1rem; -} - -#language, -#window, -#custom-notification, -#custom-music, -#tray, -#backlight, -#clock, -#wireplumber, -#custom-lock, -#custom-power { - background-color: @surface0; - padding: 0.5rem 1rem; - margin: 5px 0; -} - -#clock { - color: @blue; -} - -#backlight { - color: @yellow; -} - -#backlight { - border-radius: 0; -} - -#language { - color: @red; - border-radius: 1rem 0 0 1rem; - margin-left: 1rem; -} - -#wireplumber { - color: @maroon; -} - -#custom-music { - color: @mauve; - border-radius: 1rem; -} - -#window { - color: @mauve; - border-radius: 1rem; -} - -#custom-lock { - border-radius: 1rem 0 0 1rem; - color: @lavender; -} - -#custom-power { - margin-right: 1rem; - border-radius: 0 1rem 1rem 0; - color: @red; -} - -#custom-notification { - margin-right: 1rem; - border-radius: 0 1rem 1rem 0; - color: @sapphire; -} - -#tray { - margin-right: 1rem; - border-radius: 1rem; -} diff --git a/home-manager/hyprland/waybar/default.nix b/home-manager/hyprland/waybar/default.nix deleted file mode 100644 index 23c50f4..0000000 --- a/home-manager/hyprland/waybar/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - home.file.".config/waybar" = { - source = ./config; - recursive = true; - }; -} diff --git a/home-manager/secrets/weather-api-key b/home-manager/secrets/weather-api-key deleted file mode 100644 index f1b9cc2..0000000 Binary files a/home-manager/secrets/weather-api-key and /dev/null differ diff --git a/home-manager/wlogout/default.nix b/home-manager/wlogout/default.nix deleted file mode 100644 index de89d02..0000000 --- a/home-manager/wlogout/default.nix +++ /dev/null @@ -1,116 +0,0 @@ -# Log out and shutdown menu -{ - home.file = - let - dir = ".config/wlogout"; - in - { - "${dir}/hibernate.svg".source = ./hibernate.svg; - "${dir}/lock.svg".source = ./lock.svg; - "${dir}/logout.svg".source = ./logout.svg; - "${dir}/reboot.svg".source = ./reboot.svg; - "${dir}/shutdown.svg".source = ./shutdown.svg; - "${dir}/suspend.svg".source = ./suspend.svg; - }; - - programs.wlogout = { - enable = false; - layout = [ - { - label = "lock"; - action = "sh -c '(sleep 0.5s; hyprlock)'"; - text = "Lock"; - keybind = "l"; - } - { - label = "hibernate"; - action = "systemctl hibernate"; - text = "Hibernate"; - keybind = "h"; - } - { - label = "logout"; - action = "loginctl terminate-user $USER"; - text = "Logout"; - keybind = "e"; - } - { - label = "shutdown"; - action = "systemctl poweroff"; - text = "Shutdown"; - keybind = "s"; - } - { - label = "suspend"; - action = "systemctl suspend"; - text = "Suspend"; - keybind = "u"; - } - { - label = "reboot"; - action = "systemctl reboot"; - text = "Reboot"; - keybind = "r"; - } - ]; - style = - let - theme = import ../../theme.nix; - in - '' - * { - background-image: none; - box-shadow: none; - } - - window { - background-color: rgba(30, 30, 46, 0.9); - } - - button { - border-radius: 0; - border-color: #${theme.pinkAlpha}; - text-decoration-color: #${theme.textAlpha}; - color: #${theme.textAlpha}; - background-color: #${theme.mantleAlpha}; - border-style: solid; - border-width: 1px; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; - } - - button:focus, - button:active, - button:hover { - /* 20% Overlay 2, 80% mantle */ - background-color: rgb(48, 50, 66); - outline-style: none; - } - - #lock { - background-image: url("./lock.svg"); - } - - #logout { - background-image: url("./logout.svg"); - } - - #suspend { - background-image: url("./suspend.svg"); - } - - #hibernate { - background-image: url("./hibernate.svg"); - } - - #shutdown { - background-image: url("./shutdown.svg"); - } - - #reboot { - background-image: url("./reboot.svg"); - } - ''; - }; -} diff --git a/home-manager/wlogout/hibernate.svg b/home-manager/wlogout/hibernate.svg deleted file mode 100644 index 5626c72..0000000 --- a/home-manager/wlogout/hibernate.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/wlogout/lock.svg b/home-manager/wlogout/lock.svg deleted file mode 100644 index 4b629fd..0000000 --- a/home-manager/wlogout/lock.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/wlogout/logout.svg b/home-manager/wlogout/logout.svg deleted file mode 100644 index 3e0cc80..0000000 --- a/home-manager/wlogout/logout.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/wlogout/reboot.svg b/home-manager/wlogout/reboot.svg deleted file mode 100644 index c05f000..0000000 --- a/home-manager/wlogout/reboot.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/wlogout/shutdown.svg b/home-manager/wlogout/shutdown.svg deleted file mode 100644 index 6693b35..0000000 --- a/home-manager/wlogout/shutdown.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/wlogout/style.css b/home-manager/wlogout/style.css deleted file mode 100644 index 54752da..0000000 --- a/home-manager/wlogout/style.css +++ /dev/null @@ -1,53 +0,0 @@ -* { - background-image: none; - box-shadow: none; -} - -window { - background-color: rgba(30, 30, 46, 0.9); -} - -button { - border-radius: 0; - border-color: #f5c2e7; - text-decoration-color: #cdd6f4; - color: #cdd6f4; - background-color: #181825; - border-style: solid; - border-width: 1px; - background-repeat: no-repeat; - background-position: center; - background-size: 25%; -} - -button:focus, -button:active, -button:hover { - /* 20% Overlay 2, 80% mantle */ - background-color: rgb(48, 50, 66); - outline-style: none; -} - -#lock { - background-image: url("./lock.svg"); -} - -#logout { - background-image: url("./logout.svg"); -} - -#suspend { - background-image: url("./suspend.svg"); -} - -#hibernate { - background-image: url("./hibernate.svg"); -} - -#shutdown { - background-image: url("./shutdown.svg"); -} - -#reboot { - background-image: url("./reboot.svg"); -} diff --git a/home-manager/wlogout/suspend.svg b/home-manager/wlogout/suspend.svg deleted file mode 100644 index 08214b4..0000000 --- a/home-manager/wlogout/suspend.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Svg Vector Icons : http://www.onlinewebfonts.com/icon - - diff --git a/home-manager/zen/default.nix b/home-manager/zen/default.nix deleted file mode 100644 index b8d3278..0000000 --- a/home-manager/zen/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, inputs, ... }: - -{ - # TODO programatically get default name - home = { - file.".zen/audtxq7n.default/chrome" = { - source = ./chrome; - recursive = true; - }; - packages = with pkgs; [ inputs.zen-browser.packages.${system}.default ]; # Beta - }; -} diff --git a/hosts/desktop/common.nix b/hosts/desktop/common.nix new file mode 100644 index 0000000..8319455 --- /dev/null +++ b/hosts/desktop/common.nix @@ -0,0 +1,4 @@ +{ + monitor1 = "DP-1"; + monitor2 = "DP-3"; +} diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix new file mode 100644 index 0000000..26e06e8 --- /dev/null +++ b/hosts/desktop/default.nix @@ -0,0 +1,11 @@ +{ + lib, + ... +}: + +{ + imports = [ + (lib.custom.relativeToRoot "shared/modules") + ./hardware-configuration.nix + ]; +} diff --git a/modules/hardware/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix similarity index 88% rename from modules/hardware/hardware-configuration.nix rename to hosts/desktop/hardware-configuration.nix index 53f0e81..b2745dc 100644 --- a/modules/hardware/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -1,10 +1,6 @@ -# 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, ... }: diff --git a/hosts/desktop/home-manager/default.nix b/hosts/desktop/home-manager/default.nix new file mode 100644 index 0000000..510a6a6 --- /dev/null +++ b/hosts/desktop/home-manager/default.nix @@ -0,0 +1,14 @@ +{ + lib, + ... +}: + +{ + imports = [ + (lib.custom.relativeToRoot "shared/home-manager") + ./hyprpaper.nix + ./settings.nix + ]; + + programs.git.signing.key = "706F53DD087A91DE"; +} diff --git a/hosts/desktop/home-manager/hyprpaper.nix b/hosts/desktop/home-manager/hyprpaper.nix new file mode 100644 index 0000000..d045fee --- /dev/null +++ b/hosts/desktop/home-manager/hyprpaper.nix @@ -0,0 +1,29 @@ +# Wallpapers +{ + lib, + theme, + ... +}: + +{ + services.hyprpaper.settings = + let + wallpaper1 = builtins.toString theme.wallpaper.monitor1; + wallpaper2 = builtins.toString theme.wallpaper.monitor2; + in + { + preload = lib.mkDefault [ + wallpaper1 + wallpaper2 + ]; + + wallpaper = + let + common = import ../common.nix; + in + lib.mkDefault [ + "${common.monitor1},${wallpaper1}" + "${common.monitor2},${wallpaper2}" + ]; + }; +} diff --git a/hosts/desktop/home-manager/settings.nix b/hosts/desktop/home-manager/settings.nix new file mode 100644 index 0000000..3ba5c23 --- /dev/null +++ b/hosts/desktop/home-manager/settings.nix @@ -0,0 +1,12 @@ +{ lib, ... }: + +{ + wayland.windowManager.hyprland.settings.monitor = + let + common = import ../common.nix; + in + lib.mkForce [ + "${common.monitor1}, 3440x1440@175, 0x0, 1" + "${common.monitor2}, 3840x2160@60, 3440x0, 1.5, transform, 1" + ]; +} diff --git a/home-manager/zen/chrome/userChrome.css b/hosts/desktop/home-manager/zen/chrome/userChrome.css similarity index 100% rename from home-manager/zen/chrome/userChrome.css rename to hosts/desktop/home-manager/zen/chrome/userChrome.css diff --git a/home-manager/zen/chrome/userContent.css b/hosts/desktop/home-manager/zen/chrome/userContent.css similarity index 100% rename from home-manager/zen/chrome/userContent.css rename to hosts/desktop/home-manager/zen/chrome/userContent.css diff --git a/home-manager/zen/chrome/zen-logo.svg b/hosts/desktop/home-manager/zen/chrome/zen-logo.svg similarity index 100% rename from home-manager/zen/chrome/zen-logo.svg rename to hosts/desktop/home-manager/zen/chrome/zen-logo.svg diff --git a/hosts/desktop/home-manager/zen/default.nix b/hosts/desktop/home-manager/zen/default.nix new file mode 100644 index 0000000..fa562fc --- /dev/null +++ b/hosts/desktop/home-manager/zen/default.nix @@ -0,0 +1,7 @@ +{ + # TODO merge with shared + home.file.".zen/audtxq7n.default/chrome" = { + source = ./chrome; + recursive = true; + }; +} diff --git a/hosts/pi4/default.nix b/hosts/pi4/default.nix new file mode 100644 index 0000000..ff19397 --- /dev/null +++ b/hosts/pi4/default.nix @@ -0,0 +1,54 @@ +{ + pkgs, + hostName, + user, + version, + ... +}: + +{ + boot = { + kernelPackages = pkgs.linuxKernel.packages.linux_rpi4; + initrd.availableKernelModules = [ + "xhci_pci" + "usbhid" + "usb_storage" + ]; + loader = { + grub.enable = false; + generic-extlinux-compatible.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + vim + ]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + }; + + hardware.enableRedistributableFirmware = true; + + networking = { + inherit hostName; + networkmanager.enable = true; + }; + + services.openssh.enable = true; + + system.stateVersion = version; + + users = { + mutableUsers = false; + users.${user.name} = { + isNormalUser = true; + password = user.password; + extraGroups = [ "wheel" ]; + }; + }; +} diff --git a/hosts/thinkpad/battery.nix b/hosts/thinkpad/battery.nix new file mode 100644 index 0000000..0dbad90 --- /dev/null +++ b/hosts/thinkpad/battery.nix @@ -0,0 +1,6 @@ +{ + services = { + upower.enable = true; + power-profiles-daemon.enable = true; + }; +} diff --git a/hosts/thinkpad/bluetooth.nix b/hosts/thinkpad/bluetooth.nix new file mode 100644 index 0000000..a11b59f --- /dev/null +++ b/hosts/thinkpad/bluetooth.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = [ + pkgs.bluez + ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; # powers up the default Bluetooth controller on boot + }; + + services.blueman.enable = true; +} diff --git a/hosts/thinkpad/common.nix b/hosts/thinkpad/common.nix new file mode 100644 index 0000000..f27b268 --- /dev/null +++ b/hosts/thinkpad/common.nix @@ -0,0 +1,4 @@ +{ + # Empty matches all monitors + monitor1 = ""; +} diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix new file mode 100644 index 0000000..48dd47b --- /dev/null +++ b/hosts/thinkpad/default.nix @@ -0,0 +1,23 @@ +{ + pkgs, + lib, + ... +}: + +{ + imports = [ + (lib.custom.relativeToRoot "shared/modules") + ./battery.nix + ./bluetooth.nix + ./hardware-configuration.nix + ./security.nix + ]; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + environment.systemPackages = with pkgs; [ + brightnessctl + hyprsunset # Blue light filter + ]; + +} diff --git a/hosts/thinkpad/hardware-configuration.nix b/hosts/thinkpad/hardware-configuration.nix new file mode 100644 index 0000000..a46c293 --- /dev/null +++ b/hosts/thinkpad/hardware-configuration.nix @@ -0,0 +1,57 @@ +# 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 = [ + "nvme" + "xhci_pci" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/5ac9c425-35ae-47d5-a683-68ee0dbfc2bc"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-99b73f22-3fa1-42b5-ad48-54b0ccff72cc".device = + "/dev/disk/by-uuid/99b73f22-3fa1-42b5-ad48-54b0ccff72cc"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/3CFB-D12A"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # 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.enp2s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/thinkpad/home-manager/default.nix b/hosts/thinkpad/home-manager/default.nix new file mode 100644 index 0000000..d5b2ba3 --- /dev/null +++ b/hosts/thinkpad/home-manager/default.nix @@ -0,0 +1,14 @@ +{ + lib, + ... +}: + +{ + imports = [ + (lib.custom.relativeToRoot "shared/home-manager") + ./hyprland + ./zen + ]; + + programs.git.signing.key = "848D71DE0590C199"; +} diff --git a/hosts/thinkpad/home-manager/hyprland/default.nix b/hosts/thinkpad/home-manager/hyprland/default.nix new file mode 100644 index 0000000..5459c8c --- /dev/null +++ b/hosts/thinkpad/home-manager/hyprland/default.nix @@ -0,0 +1,7 @@ +# Home configurations for Hyprland. For system configs, see ./modules/hyprland +{ + imports = [ + ./hyprpanel.nix + ./settings.nix + ]; +} diff --git a/hosts/thinkpad/home-manager/hyprland/hyprpanel.nix b/hosts/thinkpad/home-manager/hyprland/hyprpanel.nix new file mode 100644 index 0000000..68594c8 --- /dev/null +++ b/hosts/thinkpad/home-manager/hyprland/hyprpanel.nix @@ -0,0 +1,16 @@ +{ + lib, + ... +}: + +{ + programs.hyprpanel.settings.layout."bar.layouts"."*".right = lib.mkDefault [ + "kbinput" + "volume" + "network" + "systray" + "clock" + "battery" + "notifications" + ]; +} diff --git a/hosts/thinkpad/home-manager/hyprland/settings.nix b/hosts/thinkpad/home-manager/hyprland/settings.nix new file mode 100644 index 0000000..0b11230 --- /dev/null +++ b/hosts/thinkpad/home-manager/hyprland/settings.nix @@ -0,0 +1,33 @@ +{ + lib, + ... +}: + +{ + wayland.windowManager.hyprland.settings = { + monitor = + let + common = import ../../common.nix; + in + lib.mkForce [ + "${common.monitor1}, 1920x1080@60.05, 0x0, 1" + ]; + + # Autostart + exec-once = [ + "hyprsunset -t 5000" # Set blue light filter + ]; + + input = { + sensitivity = lib.mkDefault 0.4; # -1.0 - 1.0, 0 means no modification. + touchpad.natural_scroll = lib.mkDefault true; + }; + + gestures = lib.mkDefault { + workspace_swipe = true; + workspace_swipe_distance = 150; + workspace_swipe_min_speed_to_force = 0; + workspace_swipe_cancel_ratio = 0.5; + }; + }; +} diff --git a/hosts/thinkpad/home-manager/zen/chrome/userChrome.css b/hosts/thinkpad/home-manager/zen/chrome/userChrome.css new file mode 100644 index 0000000..b37a865 --- /dev/null +++ b/hosts/thinkpad/home-manager/zen/chrome/userChrome.css @@ -0,0 +1,113 @@ +/* Catppuccin Mocha Blue userChrome.css*/ + +@media (prefers-color-scheme: dark) { + :root { + --zen-colors-primary: #313244 !important; + --zen-primary-color: #89b4fa !important; + --zen-colors-secondary: #313244 !important; + --zen-colors-tertiary: #181825 !important; + --zen-colors-border: #89b4fa !important; + --toolbarbutton-icon-fill: #89b4fa !important; + --lwt-text-color: #cdd6f4 !important; + --toolbar-field-color: #cdd6f4 !important; + --tab-selected-textcolor: rgb(171, 197, 247) !important; + --toolbar-field-focus-color: #cdd6f4 !important; + --toolbar-color: #cdd6f4 !important; + --newtab-text-primary-color: #cdd6f4 !important; + --arrowpanel-color: #cdd6f4 !important; + --arrowpanel-background: #1e1e2e !important; + --sidebar-text-color: #cdd6f4 !important; + --lwt-sidebar-text-color: #cdd6f4 !important; + --lwt-sidebar-background-color: #11111b !important; + --toolbar-bgcolor: #313244 !important; + --newtab-background-color: #1e1e2e !important; + --zen-themed-toolbar-bg: #181825 !important; + --zen-main-browser-background: #181825 !important; + } + + #permissions-granted-icon { + color: #181825 !important; + } + + .sidebar-placesTree { + background-color: #1e1e2e !important; + } + + #zen-workspaces-button { + background-color: #1e1e2e !important; + } + + #TabsToolbar { + background-color: #181825 !important; + } + + #urlbar-background { + background-color: #1e1e2e !important; + } + + .content-shortcuts { + background-color: #1e1e2e !important; + border-color: #89b4fa !important; + } + + .urlbarView-url { + color: #89b4fa !important; + } + + #zenEditBookmarkPanelFaviconContainer { + background: #11111b !important; + } + + toolbar .toolbarbutton-1 { + &:not([disabled]) { + &:is([open], [checked]) + > :is( + .toolbarbutton-icon, + .toolbarbutton-text, + .toolbarbutton-badge-stack + ) { + fill: #11111b; + } + } + } + + .identity-color-blue { + --identity-tab-color: #89b4fa !important; + --identity-icon-color: #89b4fa !important; + } + + .identity-color-turquoise { + --identity-tab-color: #94e2d5 !important; + --identity-icon-color: #94e2d5 !important; + } + + .identity-color-green { + --identity-tab-color: #a6e3a1 !important; + --identity-icon-color: #a6e3a1 !important; + } + + .identity-color-yellow { + --identity-tab-color: #f9e2af !important; + --identity-icon-color: #f9e2af !important; + } + + .identity-color-orange { + --identity-tab-color: #fab387 !important; + --identity-icon-color: #fab387 !important; + } + + .identity-color-red { + --identity-tab-color: #f38ba8 !important; + --identity-icon-color: #f38ba8 !important; + } + + .identity-color-pink { + --identity-tab-color: #f5c2e7 !important; + --identity-icon-color: #f5c2e7 !important; + } + + .identity-color-purple { + --identity-tab-color: #cba6f7 !important; + --identity-icon-color: #cba6f7 !important; + } +} diff --git a/hosts/thinkpad/home-manager/zen/chrome/userContent.css b/hosts/thinkpad/home-manager/zen/chrome/userContent.css new file mode 100644 index 0000000..036655d --- /dev/null +++ b/hosts/thinkpad/home-manager/zen/chrome/userContent.css @@ -0,0 +1,158 @@ +/* Catppuccin Mocha Blue userContent.css*/ + +@media (prefers-color-scheme: dark) { + /* Common variables affecting all pages */ + @-moz-document url-prefix("about:") { + :root { + --in-content-page-color: #cdd6f4 !important; + --color-accent-primary: #89b4fa !important; + --color-accent-primary-hover: rgb(163, 197, 251) !important; + --color-accent-primary-active: rgb(138, 153, 250) !important; + background-color: #1e1e2e !important; + --in-content-page-background: #1e1e2e !important; + } + } + + /* Variables and styles specific to about:newtab and about:home */ + @-moz-document url("about:newtab"), url("about:home") { + :root { + --newtab-background-color: #1e1e2e !important; + --newtab-background-color-secondary: #313244 !important; + --newtab-element-hover-color: #313244 !important; + --newtab-text-primary-color: #cdd6f4 !important; + --newtab-wordmark-color: #cdd6f4 !important; + --newtab-primary-action-background: #89b4fa !important; + } + + .icon { + color: #89b4fa !important; + } + + .search-wrapper .logo-and-wordmark .logo { + background: + url("zen-logo-mocha.svg"), + url("https://raw.githubusercontent.com/IAmJafeth/zen-browser/main/themes/Mocha/Blue/zen-logo-mocha.svg") + no-repeat center !important; + display: inline-block !important; + height: 82px !important; + width: 82px !important; + background-size: 82px !important; + } + + @media (max-width: 609px) { + .search-wrapper .logo-and-wordmark .logo { + background-size: 64px !important; + height: 64px !important; + width: 64px !important; + } + } + + .card-outer:is(:hover, :focus, .active):not(.placeholder) .card-title { + color: #89b4fa !important; + } + + .top-site-outer .search-topsite { + background-color: #89b4fa !important; + } + + .compact-cards .card-outer .card-context .card-context-icon.icon-download { + fill: #a6e3a1 !important; + } + } + + /* Variables and styles specific to about:preferences */ + @-moz-document url-prefix("about:preferences") { + :root { + --zen-colors-tertiary: #181825 !important; + --in-content-text-color: #cdd6f4 !important; + --link-color: #89b4fa !important; + --link-color-hover: rgb(163, 197, 251) !important; + --zen-colors-primary: #313244 !important; + --in-content-box-background: #313244 !important; + --zen-primary-color: #89b4fa !important; + } + + groupbox, + moz-card { + background: #1e1e2e !important; + } + + button, + groupbox menulist { + background: #313244 !important; + color: #cdd6f4 !important; + } + + .main-content { + background-color: #11111b !important; + } + + .identity-color-blue { + --identity-tab-color: #8aadf4 !important; + --identity-icon-color: #8aadf4 !important; + } + + .identity-color-turquoise { + --identity-tab-color: #8bd5ca !important; + --identity-icon-color: #8bd5ca !important; + } + + .identity-color-green { + --identity-tab-color: #a6da95 !important; + --identity-icon-color: #a6da95 !important; + } + + .identity-color-yellow { + --identity-tab-color: #eed49f !important; + --identity-icon-color: #eed49f !important; + } + + .identity-color-orange { + --identity-tab-color: #f5a97f !important; + --identity-icon-color: #f5a97f !important; + } + + .identity-color-red { + --identity-tab-color: #ed8796 !important; + --identity-icon-color: #ed8796 !important; + } + + .identity-color-pink { + --identity-tab-color: #f5bde6 !important; + --identity-icon-color: #f5bde6 !important; + } + + .identity-color-purple { + --identity-tab-color: #c6a0f6 !important; + --identity-icon-color: #c6a0f6 !important; + } + } + + /* Variables and styles specific to about:addons */ + @-moz-document url-prefix("about:addons") { + :root { + --zen-dark-color-mix-base: #181825 !important; + --background-color-box: #1e1e2e !important; + } + } + + /* Variables and styles specific to about:protections */ + @-moz-document url-prefix("about:protections") { + :root { + --zen-primary-color: #1e1e2e !important; + --social-color: #cba6f7 !important; + --coockie-color: #89dceb !important; + --fingerprinter-color: #f9e2af !important; + --cryptominer-color: #b4befe !important; + --tracker-color: #a6e3a1 !important; + --in-content-primary-button-background-hover: rgb(81, 83, 105) !important; + --in-content-primary-button-text-color-hover: #cdd6f4 !important; + --in-content-primary-button-background: #45475a !important; + --in-content-primary-button-text-color: #cdd6f4 !important; + } + + .card { + background-color: #313244 !important; + } + } +} diff --git a/hosts/thinkpad/home-manager/zen/chrome/zen-logo.svg b/hosts/thinkpad/home-manager/zen/chrome/zen-logo.svg new file mode 100644 index 0000000..3038ff2 --- /dev/null +++ b/hosts/thinkpad/home-manager/zen/chrome/zen-logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/hosts/thinkpad/home-manager/zen/default.nix b/hosts/thinkpad/home-manager/zen/default.nix new file mode 100644 index 0000000..15d93cc --- /dev/null +++ b/hosts/thinkpad/home-manager/zen/default.nix @@ -0,0 +1,7 @@ +{ + # TODO merge with shared + home.file.".zen/xdaxqlov.default/chrome" = { + source = ./chrome; + recursive = true; + }; +} diff --git a/hosts/thinkpad/security.nix b/hosts/thinkpad/security.nix new file mode 100644 index 0000000..bcfc93a --- /dev/null +++ b/hosts/thinkpad/security.nix @@ -0,0 +1,45 @@ +{ pkgs, ... }: + +{ + security = { + pam = { + services = { + gdm-fingerprint.text = '' + auth required pam_shells.so + auth requisite pam_nologin.so + auth requisite pam_faillock.so preauth + auth required ${pkgs.fprintd}/lib/security/pam_fprintd.so + auth optional pam_permit.so + auth required pam_env.so + auth [success=ok default=1] ${pkgs.gdm}/lib/security/pam_gdm.so + auth optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so + + account include login + + password required pam_deny.so + + session include login + session optional ${pkgs.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start + ''; + login.fprintAuth = false; + }; + }; + }; + + # Start the driver at boot + systemd.services.fprintd = { + wantedBy = [ "multi-user.target" ]; + serviceConfig.Type = "simple"; + }; + + # Install the driver + services.fprintd = { + enable = true; + tod.driver = pkgs.libfprint-2-tod1-goodix-550a; # Goodix 550a driver (from Lenovo) + }; + + # however for focaltech 2808:a658, use fprintd with overidden package (without tod) + # services.fprintd.package = pkgs.fprintd.override { + # libfprint = pkgs.libfprint-focaltech-2808-a658; + # }; +} diff --git a/justfile b/justfile index a654adf..01ee804 100644 --- a/justfile +++ b/justfile @@ -34,3 +34,7 @@ lock: # Decrypt all files in the repo using git-crypt and the user's GPG key unlock: git-crypt unlock ~/.config/git/crypt-key + +# Connect to tailnet or sign-in if not registered +start-tailscale: + tailscale up --login-server https://vpn.martials.no diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..5093e51 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,24 @@ +# FIXME(lib.custom): Add some stuff from hmajid2301/dotfiles/lib/module/default.nix, as simplifies option declaration +{ lib, ... }: + +{ + getSecret = with lib.strings; filePath: trim (removeSuffix "\n" (builtins.readFile filePath)); + + # use path relative to the root of the project + relativeToRoot = lib.path.append ../.; + + scanPaths = + path: + builtins.map (f: (path + "/${f}")) ( + builtins.attrNames ( + lib.attrsets.filterAttrs ( + path: _type: + (_type == "directory") # include directories + || ( + (path != "default.nix") # ignore default.nix + && (lib.strings.hasSuffix ".nix" path) # include .nix files + ) + ) (builtins.readDir path) + ) + ); +} diff --git a/overlays.nix b/overlays.nix index b41909f..06cef4a 100644 --- a/overlays.nix +++ b/overlays.nix @@ -1,7 +1,11 @@ { inputs, ... }: { - nixpkgs.overlays = with inputs; [ - hyprpanel.overlay - ]; + # Gives access to unstable packages everywhere + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; } diff --git a/Catppuccin.png b/shared/assets/Catppuccin.png similarity index 100% rename from Catppuccin.png rename to shared/assets/Catppuccin.png diff --git a/assets/catppuccin_high.png b/shared/assets/catppuccin_high.png similarity index 100% rename from assets/catppuccin_high.png rename to shared/assets/catppuccin_high.png diff --git a/assets/catppuccin_page_curl.png b/shared/assets/catppuccin_page_curl.png similarity index 100% rename from assets/catppuccin_page_curl.png rename to shared/assets/catppuccin_page_curl.png diff --git a/assets/downtown.gif b/shared/assets/downtown.gif similarity index 100% rename from assets/downtown.gif rename to shared/assets/downtown.gif diff --git a/assets/ekg_v2.png b/shared/assets/ekg_v2.png similarity index 100% rename from assets/ekg_v2.png rename to shared/assets/ekg_v2.png diff --git a/assets/face.png b/shared/assets/face.png similarity index 100% rename from assets/face.png rename to shared/assets/face.png diff --git a/assets/nixos_waves.png b/shared/assets/nixos_waves.png similarity index 100% rename from assets/nixos_waves.png rename to shared/assets/nixos_waves.png diff --git a/common.nix b/shared/common.nix similarity index 73% rename from common.nix rename to shared/common.nix index db69804..5de9181 100644 --- a/common.nix +++ b/shared/common.nix @@ -3,7 +3,7 @@ rec { browser = "zen"; calculator = "gnome-calculator"; fileManager = "nautilus"; - imageViewer = "loupe"; + imageViewer = "imv"; lockScreen = "hyprlock"; terminal = "kitty"; }; @@ -13,19 +13,15 @@ rec { pictures = "${dir.home}/Pictures"; }; - hostname = "nixos"; - keymaps = { layout = "gb,no"; options = "grp:alt_shift_toggle"; # Toggle using ALT + SHIFT }; - # Empty matches all - monitor1 = "DP-1"; - monitor2 = "DP-3"; - username = "martin"; + root = ../.; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave @@ -33,9 +29,4 @@ rec { # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.version = "24.11"; - - secret.weatherApiKey = lib: loadSecret lib ./home-manager/secrets/weather-api-key; - - loadSecret = - lib: filePath: lib.strings.trim (lib.strings.removeSuffix "\n" (builtins.readFile filePath)); } diff --git a/home-manager/btop.nix b/shared/home-manager/btop.nix similarity index 100% rename from home-manager/btop.nix rename to shared/home-manager/btop.nix diff --git a/home-manager/cava/cava.png b/shared/home-manager/cava/cava.png similarity index 100% rename from home-manager/cava/cava.png rename to shared/home-manager/cava/cava.png diff --git a/home-manager/cava/default.nix b/shared/home-manager/cava/default.nix similarity index 100% rename from home-manager/cava/default.nix rename to shared/home-manager/cava/default.nix diff --git a/home-manager/cursors.nix b/shared/home-manager/cursors.nix similarity index 100% rename from home-manager/cursors.nix rename to shared/home-manager/cursors.nix diff --git a/home-manager/default-applications.nix b/shared/home-manager/default-applications.nix similarity index 100% rename from home-manager/default-applications.nix rename to shared/home-manager/default-applications.nix diff --git a/home-manager/default.nix b/shared/home-manager/default.nix similarity index 86% rename from home-manager/default.nix rename to shared/home-manager/default.nix index 71172c5..b555ebf 100644 --- a/home-manager/default.nix +++ b/shared/home-manager/default.nix @@ -1,5 +1,6 @@ { inputs, + outputs, common, ... }: @@ -24,7 +25,6 @@ in ./media ./nextcloud.nix ./rofi - ./wlogout ./hyprland ./spicetify.nix ./yazi @@ -45,6 +45,9 @@ in stateVersion = common.system.version; }; + # Adds pkgs.unstable in order to fetch packages from unstable repositories + nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; + # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/home-manager/development/default.nix b/shared/home-manager/development/default.nix similarity index 100% rename from home-manager/development/default.nix rename to shared/home-manager/development/default.nix diff --git a/home-manager/development/git.nix b/shared/home-manager/development/git.nix similarity index 86% rename from home-manager/development/git.nix rename to shared/home-manager/development/git.nix index f88ea91..53e4d91 100644 --- a/home-manager/development/git.nix +++ b/shared/home-manager/development/git.nix @@ -20,12 +20,10 @@ p = "push"; }; - signing = { - signByDefault = true; - key = "706F53DD087A91DE"; - }; + signing.signByDefault = true; extraConfig = { + pull.rebase = true; push.autoSetupRemote = true; safe.directory = "/etc/nixos"; credential.helper = "${package}/bin/git-credential-libsecret"; diff --git a/home-manager/development/nixvim/default.nix b/shared/home-manager/development/nixvim/default.nix similarity index 100% rename from home-manager/development/nixvim/default.nix rename to shared/home-manager/development/nixvim/default.nix diff --git a/home-manager/development/zed.nix b/shared/home-manager/development/zed.nix similarity index 100% rename from home-manager/development/zed.nix rename to shared/home-manager/development/zed.nix diff --git a/home-manager/fastfetch.nix b/shared/home-manager/fastfetch.nix similarity index 93% rename from home-manager/fastfetch.nix rename to shared/home-manager/fastfetch.nix index c22ee20..8dfd272 100644 --- a/home-manager/fastfetch.nix +++ b/shared/home-manager/fastfetch.nix @@ -1,3 +1,5 @@ +{ lib, ... }: + { programs = { fish.shellAliases.fetch = "fastfetch"; @@ -6,7 +8,7 @@ enable = true; settings = { logo = { - source = "${../Catppuccin.png}"; + source = "${lib.custom.relativeToRoot "shared/assets/Catppuccin.png"}"; type = "kitty"; height = 18; padding.top = 2; diff --git a/home-manager/fish.nix b/shared/home-manager/fish.nix similarity index 100% rename from home-manager/fish.nix rename to shared/home-manager/fish.nix diff --git a/home-manager/freetube.nix b/shared/home-manager/freetube.nix similarity index 100% rename from home-manager/freetube.nix rename to shared/home-manager/freetube.nix diff --git a/home-manager/gpg.nix b/shared/home-manager/gpg.nix similarity index 100% rename from home-manager/gpg.nix rename to shared/home-manager/gpg.nix diff --git a/home-manager/gtk.nix b/shared/home-manager/gtk.nix similarity index 100% rename from home-manager/gtk.nix rename to shared/home-manager/gtk.nix diff --git a/home-manager/hyprland/binds.nix b/shared/home-manager/hyprland/binds.nix similarity index 100% rename from home-manager/hyprland/binds.nix rename to shared/home-manager/hyprland/binds.nix diff --git a/home-manager/hyprland/default.nix b/shared/home-manager/hyprland/default.nix similarity index 51% rename from home-manager/hyprland/default.nix rename to shared/home-manager/hyprland/default.nix index 7948acc..fbe6409 100644 --- a/home-manager/hyprland/default.nix +++ b/shared/home-manager/hyprland/default.nix @@ -1,22 +1,15 @@ -# Home configurations for Hyprland. For system configs, see ./modules/hyprland -{ outputs, ... }: - +# Home configurations for Hyprland. For system configs, see ./shared/modules/hyprland { imports = [ ./binds.nix - ./waybar ./hypridle ./hyprlock ./hyprpanel ./hyprpaper.nix ./hyprshot.nix ./settings.nix - ./swaync ]; - # Adds pkgs.unstable in order to fetch packages from unstable repositories - nixpkgs.overlays = [ outputs.overlays.unstable-packages ]; - wayland.windowManager.hyprland = { enable = true; systemd.variables = [ "--all" ]; # Import environment into systemd diff --git a/home-manager/hyprland/hypridle/default.nix b/shared/home-manager/hyprland/hypridle/default.nix similarity index 100% rename from home-manager/hyprland/hypridle/default.nix rename to shared/home-manager/hyprland/hypridle/default.nix diff --git a/home-manager/hyprland/hyprlock/default.nix b/shared/home-manager/hyprland/hyprlock/default.nix similarity index 100% rename from home-manager/hyprland/hyprlock/default.nix rename to shared/home-manager/hyprland/hyprlock/default.nix diff --git a/home-manager/hyprland/hyprpanel/default.nix b/shared/home-manager/hyprland/hyprpanel/default.nix similarity index 68% rename from home-manager/hyprland/hyprpanel/default.nix rename to shared/home-manager/hyprland/hyprpanel/default.nix index 75fe6d0..d8d2637 100644 --- a/home-manager/hyprland/hyprpanel/default.nix +++ b/shared/home-manager/hyprland/hyprpanel/default.nix @@ -17,34 +17,15 @@ # Fix the overwrite issue with HyprPanel. overwrite.enable = true; - # Import a theme from './themes/*.json'. - theme = ""; - # Override the final config with an arbitrary set. # Useful for overriding colors in your selected theme. - # Default: {} + # TODO fixes theming bugs in recent versions, should be removed when fixed override = { - theme.bar.menus.text = "#123ABC"; - }; - - # Configure bar layouts for monitors. - layout = { - "bar.layouts" = { - "*" = { - left = [ - "dashboard" - "workspaces" - "windowtitle" - ]; - middle = [ "media" ]; - right = [ - "kbinput" - "volume" - "network" - "systray" - "clock" - "notifications" - ]; + theme = { + bar.transparent = true; + font = { + name = "${theme.nerdFont} NF"; + size = "15px"; }; }; }; @@ -60,16 +41,42 @@ customModules.kbLayout.leftClick = "hyprctl switchxkblayout keychron-keychron-k8-pro next"; launcher.autoDetectIcon = true; network.label = false; - volume = { - scrollDown = "${pkgs.hyprpanel}/bin/hyprpanel 'vol -1'"; - scrollUp = "${pkgs.hyprpanel}/bin/hyprpanel 'vol +1'"; - }; + volume = + let + step = "1"; + in + { + scrollDown = "${pkgs.hyprpanel}/bin/hyprpanel 'vol -${step}'"; + scrollUp = "${pkgs.hyprpanel}/bin/hyprpanel 'vol +${step}'"; + }; workspaces = { show_icons = false; show_numbered = true; }; }; + # Configure bar layouts for monitors. + layout = { + "bar.layouts" = { + "*" = { + left = [ + "dashboard" + "workspaces" + "windowtitle" + ]; + middle = [ "media" ]; + right = [ + "kbinput" + "volume" + "network" + "systray" + "clock" + "notifications" + ]; + }; + }; + }; + menus = { clock = { time = { @@ -79,7 +86,7 @@ weather = { unit = "metric"; location = "Bergen, Norway"; - key = common.secret.weatherApiKey lib; + key = with lib.custom; getSecret (relativeToRoot "shared/secrets/weather-api-key"); }; }; diff --git a/home-manager/hyprland/hyprpaper.nix b/shared/home-manager/hyprland/hyprpaper.nix similarity index 55% rename from home-manager/hyprland/hyprpaper.nix rename to shared/home-manager/hyprland/hyprpaper.nix index ee98dcb..879fb6e 100644 --- a/home-manager/hyprland/hyprpaper.nix +++ b/shared/home-manager/hyprland/hyprpaper.nix @@ -1,7 +1,6 @@ # Wallpapers { pkgs, - common, theme, ... }: @@ -13,8 +12,7 @@ enable = true; settings = let - monitor1 = builtins.toString theme.wallpaper.monitor1; - monitor2 = builtins.toString theme.wallpaper.monitor2; + defaultWallpaper = builtins.toString theme.wallpaper.default; in { ipc = "on"; @@ -22,13 +20,11 @@ splash_offset = 2.0; preload = [ - monitor1 - monitor2 + defaultWallpaper ]; wallpaper = [ - "${common.monitor1},${monitor1}" - "${common.monitor2},${monitor2}" + ",${defaultWallpaper}" ]; }; }; diff --git a/home-manager/hyprland/hyprshot.nix b/shared/home-manager/hyprland/hyprshot.nix similarity index 100% rename from home-manager/hyprland/hyprshot.nix rename to shared/home-manager/hyprland/hyprshot.nix diff --git a/home-manager/hyprland/settings.nix b/shared/home-manager/hyprland/settings.nix similarity index 96% rename from home-manager/hyprland/settings.nix rename to shared/home-manager/hyprland/settings.nix index 233ba8f..668488c 100644 --- a/home-manager/hyprland/settings.nix +++ b/shared/home-manager/hyprland/settings.nix @@ -10,8 +10,7 @@ in { wayland.windowManager.hyprland.settings = { monitor = [ - "${common.monitor1}, 3440x1440@175, 0x0, 1" - "${common.monitor2}, 3840x2160@60, 3440x0, 1.5, transform, 1" + ", preferred, auto, 1" ]; # Autostart diff --git a/home-manager/kitty.nix b/shared/home-manager/kitty.nix similarity index 100% rename from home-manager/kitty.nix rename to shared/home-manager/kitty.nix diff --git a/home-manager/media/default.nix b/shared/home-manager/media/default.nix similarity index 100% rename from home-manager/media/default.nix rename to shared/home-manager/media/default.nix diff --git a/home-manager/media/imv.nix b/shared/home-manager/media/imv.nix similarity index 100% rename from home-manager/media/imv.nix rename to shared/home-manager/media/imv.nix diff --git a/home-manager/media/mpv.nix b/shared/home-manager/media/mpv.nix similarity index 100% rename from home-manager/media/mpv.nix rename to shared/home-manager/media/mpv.nix diff --git a/home-manager/nextcloud.nix b/shared/home-manager/nextcloud.nix similarity index 100% rename from home-manager/nextcloud.nix rename to shared/home-manager/nextcloud.nix diff --git a/home-manager/rofi/catppuccin-mocha.rasi b/shared/home-manager/rofi/catppuccin-mocha.rasi similarity index 100% rename from home-manager/rofi/catppuccin-mocha.rasi rename to shared/home-manager/rofi/catppuccin-mocha.rasi diff --git a/home-manager/rofi/config.rasi b/shared/home-manager/rofi/config.rasi similarity index 100% rename from home-manager/rofi/config.rasi rename to shared/home-manager/rofi/config.rasi diff --git a/home-manager/rofi/default.nix b/shared/home-manager/rofi/default.nix similarity index 100% rename from home-manager/rofi/default.nix rename to shared/home-manager/rofi/default.nix diff --git a/home-manager/rofi/rofimoji.rc b/shared/home-manager/rofi/rofimoji.rc similarity index 100% rename from home-manager/rofi/rofimoji.rc rename to shared/home-manager/rofi/rofimoji.rc diff --git a/home-manager/spicetify.nix b/shared/home-manager/spicetify.nix similarity index 100% rename from home-manager/spicetify.nix rename to shared/home-manager/spicetify.nix diff --git a/home-manager/yazi/catppuccin-mocha.tmTheme b/shared/home-manager/yazi/catppuccin-mocha.tmTheme similarity index 100% rename from home-manager/yazi/catppuccin-mocha.tmTheme rename to shared/home-manager/yazi/catppuccin-mocha.tmTheme diff --git a/home-manager/yazi/default.nix b/shared/home-manager/yazi/default.nix similarity index 100% rename from home-manager/yazi/default.nix rename to shared/home-manager/yazi/default.nix diff --git a/home-manager/yazi/icons.nix b/shared/home-manager/yazi/icons.nix similarity index 100% rename from home-manager/yazi/icons.nix rename to shared/home-manager/yazi/icons.nix diff --git a/shared/home-manager/zen/default.nix b/shared/home-manager/zen/default.nix new file mode 100644 index 0000000..f8d71cb --- /dev/null +++ b/shared/home-manager/zen/default.nix @@ -0,0 +1,5 @@ +{ pkgs, inputs, ... }: + +{ + home.packages = with pkgs; [ inputs.zen-browser.packages.${system}.default ]; # Beta +} diff --git a/shared/modules/boot.nix b/shared/modules/boot.nix new file mode 100644 index 0000000..fca6970 --- /dev/null +++ b/shared/modules/boot.nix @@ -0,0 +1,6 @@ +{ + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; +} diff --git a/modules/default.nix b/shared/modules/default.nix similarity index 51% rename from modules/default.nix rename to shared/modules/default.nix index 5999ba5..c9f43ed 100644 --- a/modules/default.nix +++ b/shared/modules/default.nix @@ -1,17 +1,28 @@ { imports = [ + ./boot.nix ./development + ./electron.nix ./fonts.nix ./gaming ./gnome ./hardware + ./kdeconnect.nix ./locale.nix + ./mail.nix + ./media.nix ./networking.nix + ./nixos.nix ./nix-helper.nix + ./office.nix ./hyprland ./sddm.nix - ./security.nix + ./security ./shell.nix + ./social.nix + ./users.nix ./qt.nix + ./xdg.nix + ./xserver.nix ]; } diff --git a/modules/development/default.nix b/shared/modules/development/default.nix similarity index 100% rename from modules/development/default.nix rename to shared/modules/development/default.nix diff --git a/modules/development/docker.nix b/shared/modules/development/docker.nix similarity index 100% rename from modules/development/docker.nix rename to shared/modules/development/docker.nix diff --git a/modules/development/dotnet.nix b/shared/modules/development/dotnet.nix similarity index 100% rename from modules/development/dotnet.nix rename to shared/modules/development/dotnet.nix diff --git a/modules/development/nix.nix b/shared/modules/development/nix.nix similarity index 100% rename from modules/development/nix.nix rename to shared/modules/development/nix.nix diff --git a/modules/development/node.nix b/shared/modules/development/node.nix similarity index 100% rename from modules/development/node.nix rename to shared/modules/development/node.nix diff --git a/modules/development/ollama.nix b/shared/modules/development/ollama.nix similarity index 100% rename from modules/development/ollama.nix rename to shared/modules/development/ollama.nix diff --git a/modules/development/rust.nix b/shared/modules/development/rust.nix similarity index 100% rename from modules/development/rust.nix rename to shared/modules/development/rust.nix diff --git a/shared/modules/electron.nix b/shared/modules/electron.nix new file mode 100644 index 0000000..b76341d --- /dev/null +++ b/shared/modules/electron.nix @@ -0,0 +1,8 @@ +{ lib, systemConfig, ... }: + +{ + environment.sessionVariables = lib.mkIf systemConfig.wayland.enable { + # Tells Electron apps to use Wayland + NIXOS_OZONE_WL = "1"; + }; +} diff --git a/modules/fonts.nix b/shared/modules/fonts.nix similarity index 100% rename from modules/fonts.nix rename to shared/modules/fonts.nix diff --git a/modules/gaming/default.nix b/shared/modules/gaming/default.nix similarity index 100% rename from modules/gaming/default.nix rename to shared/modules/gaming/default.nix diff --git a/modules/gaming/steam.nix b/shared/modules/gaming/steam.nix similarity index 100% rename from modules/gaming/steam.nix rename to shared/modules/gaming/steam.nix diff --git a/modules/gnome/default.nix b/shared/modules/gnome/default.nix similarity index 100% rename from modules/gnome/default.nix rename to shared/modules/gnome/default.nix diff --git a/modules/gnome/nautilus.nix b/shared/modules/gnome/nautilus.nix similarity index 100% rename from modules/gnome/nautilus.nix rename to shared/modules/gnome/nautilus.nix diff --git a/modules/hardware/audio.nix b/shared/modules/hardware/audio.nix similarity index 100% rename from modules/hardware/audio.nix rename to shared/modules/hardware/audio.nix diff --git a/modules/hardware/default.nix b/shared/modules/hardware/default.nix similarity index 68% rename from modules/hardware/default.nix rename to shared/modules/hardware/default.nix index ffd2b30..aac2e08 100644 --- a/modules/hardware/default.nix +++ b/shared/modules/hardware/default.nix @@ -2,7 +2,6 @@ imports = [ ./audio.nix ./graphics - ./hardware-configuration.nix ./keyboard.nix ]; } diff --git a/modules/hardware/graphics/default.nix b/shared/modules/hardware/graphics/default.nix similarity index 100% rename from modules/hardware/graphics/default.nix rename to shared/modules/hardware/graphics/default.nix diff --git a/modules/hardware/graphics/nvidia.nix b/shared/modules/hardware/graphics/nvidia.nix similarity index 90% rename from modules/hardware/graphics/nvidia.nix rename to shared/modules/hardware/graphics/nvidia.nix index 6b33ac2..5b30c84 100644 --- a/modules/hardware/graphics/nvidia.nix +++ b/shared/modules/hardware/graphics/nvidia.nix @@ -1,6 +1,11 @@ -{ pkgs, ... }: - { + pkgs, + lib, + systemConfig, + ... +}: + +lib.mkIf systemConfig.nvidia.enable { boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; # For hardware acceleration diff --git a/modules/hardware/keyboard.nix b/shared/modules/hardware/keyboard.nix similarity index 100% rename from modules/hardware/keyboard.nix rename to shared/modules/hardware/keyboard.nix diff --git a/modules/hyprland/default.nix b/shared/modules/hyprland/default.nix similarity index 84% rename from modules/hyprland/default.nix rename to shared/modules/hyprland/default.nix index 3a79323..8cb2c9e 100644 --- a/modules/hyprland/default.nix +++ b/shared/modules/hyprland/default.nix @@ -1,4 +1,4 @@ -# System configurations for Hyprland. For home configs, see ./home-manager/hyprland +# System configurations for Hyprland. For home configs, see ./shared/home-manager/hyprland { pkgs, ... }: { diff --git a/shared/modules/kdeconnect.nix b/shared/modules/kdeconnect.nix new file mode 100644 index 0000000..0cb7c87 --- /dev/null +++ b/shared/modules/kdeconnect.nix @@ -0,0 +1,3 @@ +{ + programs.kdeconnect.enable = true; +} diff --git a/modules/locale.nix b/shared/modules/locale.nix similarity index 100% rename from modules/locale.nix rename to shared/modules/locale.nix diff --git a/shared/modules/mail.nix b/shared/modules/mail.nix new file mode 100644 index 0000000..ce75156 --- /dev/null +++ b/shared/modules/mail.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + unstable.protonmail-desktop + ]; +} diff --git a/shared/modules/media.nix b/shared/modules/media.nix new file mode 100644 index 0000000..3cd7107 --- /dev/null +++ b/shared/modules/media.nix @@ -0,0 +1,11 @@ +{ pkgs, inputs, ... }: + +{ + environment.systemPackages = with pkgs; [ + stremio + gimp + vlc + vdhcoapp + inputs.grayjay.packages.${system}.grayjay + ]; +} diff --git a/modules/networking.nix b/shared/modules/networking.nix similarity index 82% rename from modules/networking.nix rename to shared/modules/networking.nix index f883c5a..4e79445 100644 --- a/modules/networking.nix +++ b/shared/modules/networking.nix @@ -1,9 +1,13 @@ -{ common, ... }: +{ pkgs, systemConfig, ... }: { + environment.systemPackages = with pkgs; [ + wget + ]; + networking = { networkmanager.enable = true; - hostName = common.hostname; + hostName = systemConfig.hostName; # wireless.enable = true; # Enables wireless support via wpa_supplicant. }; diff --git a/modules/nix-helper.nix b/shared/modules/nix-helper.nix similarity index 81% rename from modules/nix-helper.nix rename to shared/modules/nix-helper.nix index f60cc0e..ba8c01b 100644 --- a/modules/nix-helper.nix +++ b/shared/modules/nix-helper.nix @@ -1,8 +1,10 @@ # Nix-Helper: github.com/viperML/nh +{ common, ... }: + { programs.nh = { enable = true; - flake = ../.; + flake = common.root; clean = { enable = true; dates = "weekly"; diff --git a/shared/modules/nixos.nix b/shared/modules/nixos.nix new file mode 100644 index 0000000..2bb4930 --- /dev/null +++ b/shared/modules/nixos.nix @@ -0,0 +1,25 @@ +{ + pkgs, + outputs, + systemConfig, + ... +}: + +{ + environment.systemPackages = with pkgs; [ + nix-prefetch-github # Cmd to get rev and hash from GitHub + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + nixpkgs = { + # Allow unfree packages + config.allowUnfree = true; + overlays = [ outputs.overlays.unstable-packages ]; + }; + + system.stateVersion = systemConfig.version; +} diff --git a/shared/modules/office.nix b/shared/modules/office.nix new file mode 100644 index 0000000..59dec77 --- /dev/null +++ b/shared/modules/office.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + onlyoffice-desktopeditors + ]; +} diff --git a/modules/qt.nix b/shared/modules/qt.nix similarity index 100% rename from modules/qt.nix rename to shared/modules/qt.nix diff --git a/modules/sddm.nix b/shared/modules/sddm.nix similarity index 100% rename from modules/sddm.nix rename to shared/modules/sddm.nix diff --git a/shared/modules/security/default.nix b/shared/modules/security/default.nix new file mode 100644 index 0000000..4fdd9fd --- /dev/null +++ b/shared/modules/security/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./yubikey.nix + ]; +} diff --git a/modules/security.nix b/shared/modules/security/yubikey.nix similarity index 88% rename from modules/security.nix rename to shared/modules/security/yubikey.nix index f050539..900d5b4 100644 --- a/modules/security.nix +++ b/shared/modules/security/yubikey.nix @@ -1,9 +1,10 @@ +# Yubikey config: https://nixos.wiki/wiki/Yubikey#pam_u2f { pkgs, ... }: { environment.systemPackages = with pkgs; [ gnupg - yubioath-flutter + yubioath-flutter # GUI ]; programs.gnupg.agent.enable = true; diff --git a/modules/shell.nix b/shared/modules/shell.nix similarity index 100% rename from modules/shell.nix rename to shared/modules/shell.nix diff --git a/shared/modules/social.nix b/shared/modules/social.nix new file mode 100644 index 0000000..26fb62a --- /dev/null +++ b/shared/modules/social.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + discord + ]; +} diff --git a/shared/modules/users.nix b/shared/modules/users.nix new file mode 100644 index 0000000..0fce21a --- /dev/null +++ b/shared/modules/users.nix @@ -0,0 +1,15 @@ +{ systemConfig, ... }: +let + username = systemConfig.user.name; +in +{ + # Define a user without a password, TODO pass in user.password + users.users.${username} = { + isNormalUser = true; + description = username; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; +} diff --git a/shared/modules/xdg.nix b/shared/modules/xdg.nix new file mode 100644 index 0000000..24b511f --- /dev/null +++ b/shared/modules/xdg.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + xdg-utils + xdg-desktop-portal + xdg-desktop-portal-gtk + ]; +} diff --git a/shared/modules/xserver.nix b/shared/modules/xserver.nix new file mode 100644 index 0000000..1d78081 --- /dev/null +++ b/shared/modules/xserver.nix @@ -0,0 +1,3 @@ +{ + services.xserver.enable = true; +} diff --git a/shared/secrets/weather-api-key b/shared/secrets/weather-api-key new file mode 100644 index 0000000..cfc8476 Binary files /dev/null and b/shared/secrets/weather-api-key differ diff --git a/theme.nix b/shared/theme.nix similarity index 96% rename from theme.nix rename to shared/theme.nix index 8114d9d..003d76b 100644 --- a/theme.nix +++ b/shared/theme.nix @@ -5,8 +5,9 @@ rec { nerdFont = "JetBrainsMono"; - wallpaper = { + wallpaper = rec { lockscreen = ./assets/catppuccin_page_curl.png; + default = monitor1; monitor1 = ./assets/nixos_waves.png; monitor2 = ./assets/ekg_v2.png; }; diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..c8df6ec --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +{ pkgs }: + +{ + # The minimum amount of dependencies in order to run 'just switch-now' + default = pkgs.mkShell { + packages = with pkgs; [ + just + git + git-crypt + nh + ]; + }; +}