From 9bdfcf8d749ec7aa431f308f4860813e0f256298 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 6 Sep 2024 17:31:20 -0400 Subject: [PATCH] flake: add wallpapers repo as input, replace fetchGit calls --- flake.lock | 19 ++++++++++++++++++- flake.nix | 6 +++++- homeManagerModules/desktop/default.nix | 7 ++----- hosts/fallarbor/stylix.nix | 16 ++++++---------- hosts/lavaridge/stylix.nix | 16 ++++++---------- hosts/mauville/stylix.nix | 16 ++++++---------- hosts/petalburg/stylix.nix | 16 ++++++---------- hosts/rustboro/stylix.nix | 16 ++++++---------- update_fetchgit.sh | 2 -- 9 files changed, 55 insertions(+), 59 deletions(-) delete mode 100755 update_fetchgit.sh diff --git a/flake.lock b/flake.lock index 8a7394ed..35a5cf68 100644 --- a/flake.lock +++ b/flake.lock @@ -579,7 +579,8 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", - "stylix": "stylix" + "stylix": "stylix", + "wallpapers": "wallpapers" } }, "rust-overlay": { @@ -698,6 +699,22 @@ "repo": "default", "type": "github" } + }, + "wallpapers": { + "flake": false, + "locked": { + "lastModified": 1725258570, + "narHash": "sha256-0do/7t7rVSYor+3M48n6nSAq56DyKCPPRn4wDcLRMQk=", + "owner": "alyraffauf", + "repo": "wallpapers", + "rev": "a02d94f99498c93d4ee9144c4e843470024f2bc9", + "type": "github" + }, + "original": { + "owner": "alyraffauf", + "repo": "wallpapers", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index b231011d..078f03eb 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,11 @@ inputs.nixpkgs.follows = "nixpkgs"; url = "github:danth/stylix"; }; + + wallpapers = { + url = "github:alyraffauf/wallpapers"; + flake = false; # This is important to specify that it's a non-flake + }; }; nixConfig = { @@ -89,7 +94,6 @@ nh ruby sbctl - update-nix-fetchgit ]) ++ [ self.formatter.${pkgs.system} diff --git a/homeManagerModules/desktop/default.nix b/homeManagerModules/desktop/default.nix index 4592c36c..5ef7d91d 100644 --- a/homeManagerModules/desktop/default.nix +++ b/homeManagerModules/desktop/default.nix @@ -2,6 +2,7 @@ config, lib, osConfig, + self, ... }: { imports = [ @@ -43,11 +44,7 @@ ) "file://${config.home.homeDirectory}/sync"; xdg = { - dataFile."backgrounds".source = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; + dataFile."backgrounds".source = self.inputs.wallpapers; userDirs = { enable = true; diff --git a/hosts/fallarbor/stylix.nix b/hosts/fallarbor/stylix.nix index ff14a736..bf1af8cf 100644 --- a/hosts/fallarbor/stylix.nix +++ b/hosts/fallarbor/stylix.nix @@ -1,16 +1,12 @@ -{pkgs, ...}: { +{ + pkgs, + self, + ... +}: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/default-dark.yaml"; - - image = let - wallpapers = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; - in "${wallpapers}/wallhaven-6d66dl.jpg"; - + image = "${self.inputs.wallpapers}/wallhaven-6d66dl.jpg"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/lavaridge/stylix.nix b/hosts/lavaridge/stylix.nix index 408053a8..dcc6c928 100644 --- a/hosts/lavaridge/stylix.nix +++ b/hosts/lavaridge/stylix.nix @@ -1,16 +1,12 @@ -{pkgs, ...}: { +{ + pkgs, + self, + ... +}: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; - - image = let - wallpapers = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; - in "${wallpapers}/wallhaven-mp886k.jpg"; - + image = "${self.inputs.wallpapers}/wallhaven-mp886k.jpg"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/mauville/stylix.nix b/hosts/mauville/stylix.nix index 408053a8..dcc6c928 100644 --- a/hosts/mauville/stylix.nix +++ b/hosts/mauville/stylix.nix @@ -1,16 +1,12 @@ -{pkgs, ...}: { +{ + pkgs, + self, + ... +}: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; - - image = let - wallpapers = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; - in "${wallpapers}/wallhaven-mp886k.jpg"; - + image = "${self.inputs.wallpapers}/wallhaven-mp886k.jpg"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/petalburg/stylix.nix b/hosts/petalburg/stylix.nix index b490d0ae..609d8139 100644 --- a/hosts/petalburg/stylix.nix +++ b/hosts/petalburg/stylix.nix @@ -1,16 +1,12 @@ -{pkgs, ...}: { +{ + pkgs, + self, + ... +}: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; - - image = let - wallpapers = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; - in "${wallpapers}/wallhaven-jxp18w.jpg"; - + image = "${self.inputs.wallpapers}/wallhaven-jxp18w.jpg"; imageScalingMode = "fill"; polarity = "dark"; diff --git a/hosts/rustboro/stylix.nix b/hosts/rustboro/stylix.nix index 3325f6e6..75c8e6ab 100644 --- a/hosts/rustboro/stylix.nix +++ b/hosts/rustboro/stylix.nix @@ -1,16 +1,12 @@ -{pkgs, ...}: { +{ + pkgs, + self, + ... +}: { stylix = { enable = true; base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-light-hard.yaml"; - - image = let - wallpapers = builtins.fetchGit { - url = "https://github.com/alyraffauf/wallpapers.git"; - rev = "c7d61966e339dd7efdda5ff176b91778086ccb73"; - ref = "master"; - }; - in "${wallpapers}/wallhaven-mp886k.jpg"; - + image = "${self.inputs.wallpapers}/wallhaven-mp886k.jpg"; imageScalingMode = "fill"; polarity = "light"; diff --git a/update_fetchgit.sh b/update_fetchgit.sh deleted file mode 100755 index f3fa5508..00000000 --- a/update_fetchgit.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -nix run nixpkgs#update-nix-fetchgit -- homeManagerModules/desktop/default.nix hosts/fallarbor/stylix.nix hosts/lavaridge/stylix.nix hosts/mauville/stylix.nix hosts/petalburg/stylix.nix hosts/rustboro/stylix.nix