diff --git a/flake.lock b/flake.lock index f19b4e8..70ace63 100644 --- a/flake.lock +++ b/flake.lock @@ -186,11 +186,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1766038392, - "narHash": "sha256-ht/GuKaw5NT3M12xM+mkUtkSBVtzjJ8IHIy6R/ncv9g=", + "lastModified": 1766524813, + "narHash": "sha256-N/sxS27+t9nGvGWqwwAceSMW/Y5ddcypS/aiTnZ7ScA=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "5fb45ece6129bd7ad8f7310df0ae9c00bae7c562", + "rev": "c2b36207f2c396c79dbed9d40536db221bd4e363", "type": "github" }, "original": { @@ -550,11 +550,11 @@ ] }, "locked": { - "lastModified": 1766387499, - "narHash": "sha256-AjK3/UKDzeXFeYNLVBaJ3+HLE9he1g5UrlNd4/BM3eA=", + "lastModified": 1766682973, + "narHash": "sha256-GKO35onS711ThCxwWcfuvbIBKXwriahGqs+WZuJ3v9E=", "owner": "nix-community", "repo": "home-manager", - "rev": "527ad07e6625302b648ed3b28c34b62a79bd103e", + "rev": "91cdb0e2d574c64fae80d221f4bf09d5592e9ec2", "type": "github" }, "original": { @@ -583,11 +583,11 @@ "homebrew-cask": { "flake": false, "locked": { - "lastModified": 1766499104, - "narHash": "sha256-19KRh3iz7tCY25MftVmpSkxp6QEyepDEZbheJXTcpb4=", + "lastModified": 1766723306, + "narHash": "sha256-L0Y6MWn30uU1q2/aeijOg6j2rPnLTlEJg2Dw0e3R84A=", "owner": "homebrew", "repo": "homebrew-cask", - "rev": "208eb291691c0234f1eb172e95ab490884fd50bd", + "rev": "fdd2bf75092e7ddfeac67415e9fc4cedd41855d9", "type": "github" }, "original": { @@ -599,11 +599,11 @@ "homebrew-core": { "flake": false, "locked": { - "lastModified": 1766500727, - "narHash": "sha256-FDQKVUgUjPvnkBJaM23K9xf3FHwksGXn/LKeBGODz/M=", + "lastModified": 1766724309, + "narHash": "sha256-LfqQoAdpIuOJQRrI9n9NCjp6zKdQh9yIU4sHaQWycD0=", "owner": "homebrew", "repo": "homebrew-core", - "rev": "ad383f0fefa7cff399414d18522a894179183e9c", + "rev": "ad0f4af25123c68dd03dac10f179d3d68ef288ee", "type": "github" }, "original": { @@ -633,11 +633,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1766225187, - "narHash": "sha256-6hcaU8qtmixsaEUbjPiOFd5aJPZxAIBokl5d7dkab3k=", + "lastModified": 1766561058, + "narHash": "sha256-VFqsBWqFFBTBqKFw0fGw2a2mJjPP9HPW8nXEW2A5zJM=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "bb53a85db9210204a98f771f10f1f5b4e06ccb2d", + "rev": "9d0abe57d633a6e08d72865a761891a8c81e740f", "type": "github" }, "original": { @@ -821,11 +821,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1766369649, - "narHash": "sha256-8Z/4upd/AS7pU72QS3GesaWeTgM4VcrSf85bh9fxum8=", + "lastModified": 1766714990, + "narHash": "sha256-vrS4gICB41cq+/nTsp6uGVJ8RiaRGr7ywoeAA9E16cw=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "94058abef65a5f2916f4d9da67d9966039366514", + "rev": "90d526878f7b905448c331b143f37065ed509381", "type": "github" }, "original": { @@ -947,11 +947,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1764440730, - "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", + "lastModified": 1766568855, + "narHash": "sha256-UXVtN77D7pzKmzOotFTStgZBqpOcf8cO95FcupWp4Zo=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", + "rev": "c5db9569ac9cc70929c268ac461f4003e3e5ca80", "type": "github" }, "original": { @@ -997,11 +997,11 @@ ] }, "locked": { - "lastModified": 1765832983, - "narHash": "sha256-9kZOSTJ6ITCoHs9gz4I06IJ2vb2S4gQd3WR4aTnWovI=", + "lastModified": 1766537363, + "narHash": "sha256-vK+eb5JfZqIrfRGv/TR5UBfnCh72s0MNlMGXPKh4fv0=", "owner": "mjallen18", "repo": "nixos-raspberrypi", - "rev": "8b00ff4f0b156eabd86f946fa7964efda04e2713", + "rev": "27c87670f0002a40b2435031133600fce1812839", "type": "github" }, "original": { @@ -1059,11 +1059,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1766201043, - "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=", + "lastModified": 1766622938, + "narHash": "sha256-Eovt/DOCYjFFBZuYbbG9j5jhklzxdNbUGVYYxh3lG3s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b3aad468604d3e488d627c0b43984eb60e75e782", + "rev": "5900a0a8850cbba98e16d5a7a6ed389402dfcf4f", "type": "github" }, "original": { @@ -1091,11 +1091,11 @@ }, "nixpkgs_11": { "locked": { - "lastModified": 1766427476, - "narHash": "sha256-KHgJHYGYuHUtJPBjczN0kFrWHmdfUXPa0Km6Yq/ELEE=", + "lastModified": 1766687550, + "narHash": "sha256-FGuhrdRvxp3DZfRZfA+1mKZIpgTU9Xboq1jVphKm9Go=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6dd5b55337d892a8a441aaad31bf1a4165b453bc", + "rev": "a3a2ddee4adfb361bdfe2e915c7e85c2e71cfc5f", "type": "github" }, "original": { @@ -1530,11 +1530,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1766440186, - "narHash": "sha256-7B/dntEDan+pMB8B/sG6599f3mQaySAJL+c9NhdMP7k=", + "lastModified": 1766603026, + "narHash": "sha256-J2DDdRqSU4w9NNgkMfmMeaLIof5PXtS9RG7y6ckDvQE=", "owner": "nix-community", "repo": "stylix", - "rev": "844294a58ef0badb3067c4f2fe063030537eb624", + "rev": "551df12ee3ebac52c5712058bd97fd9faa4c3430", "type": "github" }, "original": { diff --git a/modules/home/home/default.nix b/modules/home/home/default.nix index 57c5fad..4384de1 100644 --- a/modules/home/home/default.nix +++ b/modules/home/home/default.nix @@ -127,11 +127,12 @@ in }; services = { - nextcloud-client.enable = lib.mkDefault hasDestopEnvironment; + nextcloud-client.enable = false;#lib.mkDefault hasDestopEnvironment; pass-secret-service = lib.mkDefault enabled; kdeconnect = { enable = lib.mkDefault hasDestopEnvironment; indicator = lib.mkDefault hasDestopEnvironment; + package = pkgs.gnomeExtensions.gsconnect; }; }; } diff --git a/modules/nixos/hardware/raspberry-pi/config.nix b/modules/nixos/hardware/raspberry-pi/config.nix new file mode 100644 index 0000000..3db2b2a --- /dev/null +++ b/modules/nixos/hardware/raspberry-pi/config.nix @@ -0,0 +1,184 @@ +# This file is a modified version of config.txt generator +# Licensed under the terms of MIT License +# https://raw.githubusercontent.com/nix-community/raspberry-pi-nix/refs/heads/master/rpi/config.nix +# with modifications +# https://raw.githubusercontent.com/nvmd/raspberry-pi-nix/refs/heads/master/rpi/config.nix + +{ lib, config, pkgs, namespace, ... }: +let + cfg = config.${namespace}.hardware.raspberry-pi; + + render-raspberrypi-config = let + + render-kvs = kvs: let + render-kv = k: v: + if isNull v.value then k + else "${k}=${toString v.value}"; + in lib.attrsets.mapAttrsToList render-kv + (lib.filterAttrs (k: v: v.enable) kvs); + + render-dt-param = x: "dtparam=" + x; + render-dt-params = params: + lib.strings.concatMapStringsSep "\n" render-dt-param (render-kvs params); + + render-dt-overlay = { overlay, params }: + lib.concatStringsSep "\n" (lib.filter (x: x != "") [ + ("dtoverlay=" + overlay) + (render-dt-params params) + "dtoverlay=" + ]); + + render-options = opts: + lib.strings.concatStringsSep "\n" (render-kvs opts); + + render-base-dt-params = render-dt-params; + + render-dt-overlays = overlays: + lib.strings.concatMapStringsSep "\n" render-dt-overlay + (lib.attrsets.mapAttrsToList + (overlay: params: { + inherit overlay; + inherit (params) params; + }) + (lib.filterAttrs (k: v: v.enable) overlays)); + + render-config-section = conditionalFilter: + { options, base-dt-params, dt-overlays }: + let all-config = lib.concatStringsSep "\n" (lib.filter (x: x != "") [ + (render-options options) + (render-base-dt-params base-dt-params) + (render-dt-overlays dt-overlays) + ]); + in '' + [${conditionalFilter}] + ${all-config} + ''; + in conf: lib.strings.concatStringsSep "\n" + ((lib.attrsets.mapAttrsToList render-config-section conf) + ++ [ cfg.extra-config ]); +in { + options.${namespace}.hardware.raspberry-pi = { + config = let + rpi-config-param = { + options = { + enable = lib.mkEnableOption "attr"; + value = lib.mkOption { + type = with lib.types; oneOf [ int str bool ]; + }; + }; + }; + dt-param = { + options = { + enable = lib.mkEnableOption "attr"; + value = lib.mkOption { + type = with lib.types; nullOr (oneOf [ int str bool ]); + default = null; + }; + }; + }; + dt-overlay = { + options = { + enable = lib.mkEnableOption "overlay"; + params = lib.mkOption { + type = with lib.types; attrsOf (submodule dt-param); + default = {}; + }; + }; + }; + raspberry-pi-config-options = { + options = { + options = lib.mkOption { + type = with lib.types; attrsOf (submodule rpi-config-param); + default = { }; + description = '' + Common hardware configuration options, translates to + `