chore(nix/deps): Manage (Spiced) Spotify with Nix

This commit is contained in:
Ahmad Ansori Palembani 2024-11-06 10:31:11 +07:00
parent 4b9ac3b623
commit 01d4cf8273
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
5 changed files with 70 additions and 12 deletions

40
nix/flake.lock generated
View file

@ -88,6 +88,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -274,7 +290,7 @@
}, },
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": [ "nixpkgs": [
"system-manager", "system-manager",
@ -306,6 +322,7 @@
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur", "nur": "nur",
"spicetify-nix": "spicetify-nix",
"system-manager": "system-manager" "system-manager": "system-manager"
} }
}, },
@ -330,6 +347,27 @@
"type": "github" "type": "github"
} }
}, },
"spicetify-nix": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1730780158,
"narHash": "sha256-ZJkCFn4PL49rINz7xrjlBqw9nF8wWJE7fSVqbHlCWSA=",
"owner": "Gerg-L",
"repo": "spicetify-nix",
"rev": "2791c6662002731d3dfc00312307aef547e1c8be",
"type": "github"
},
"original": {
"owner": "Gerg-L",
"repo": "spicetify-nix",
"type": "github"
}
},
"system-manager": { "system-manager": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",

View file

@ -3,10 +3,13 @@
outputs = inputs@{ self, nix-darwin, brew-api, nixpkgs-stable, nixpkgs-unstable, home-manager, system-manager, nur, ... }: outputs = inputs@{ self, nix-darwin, brew-api, nixpkgs-stable, nixpkgs-unstable, home-manager, system-manager, nur, ... }:
let let
utils = inputs.flake-utils.lib;
vars = { vars = {
floorp = { floorp = {
verticalTabHoverWidthInEm = 18; verticalTabHoverWidthInEm = 18;
}; };
rev = self.rev or self.dirtyRev or null; rev = self.rev or self.dirtyRev or null;
}; };
in in
@ -36,8 +39,20 @@
inputs = { inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05"; nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53";
nur.url = "github:nix-community/NUR";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
home-manager = {
url = "github:nix-community/home-manager/64c6325b28ebd708653dd41d88f306023f296184";
inputs.nixpkgs.follows = "nixpkgs-unstable"; # we need unstable (24.11) for programs.floorp. FIXME: switch to stable once 24.11 become stable
};
nix-darwin = { nix-darwin = {
url = "github:LnL7/nix-darwin/189d2d422c773fa065cc9c72e6806f007ebb9be0"; url = "github:LnL7/nix-darwin/189d2d422c773fa065cc9c72e6806f007ebb9be0";
inputs.nixpkgs.follows = "nixpkgs-stable"; inputs.nixpkgs.follows = "nixpkgs-stable";
@ -51,16 +66,9 @@
flake = false; flake = false;
}; };
home-manager = {
url = "github:nix-community/home-manager/64c6325b28ebd708653dd41d88f306023f296184";
inputs.nixpkgs.follows = "nixpkgs-unstable"; # we need unstable (24.11) for programs.floorp. FIXME: switch to stable once 24.11 become stable
};
system-manager = { system-manager = {
url = "github:numtide/system-manager/c93e62f2e962b54fd961798731d25eaa5778dbe2"; url = "github:numtide/system-manager/c93e62f2e962b54fd961798731d25eaa5778dbe2";
inputs.nixpkgs.follows = "nixpkgs-stable"; inputs.nixpkgs.follows = "nixpkgs-stable";
}; };
nur.url = "github:nix-community/NUR";
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, pkgs-unstable, config, vars, common, inputs, ... }: { pkgs, pkgs-unstable, spicePkgs, config, vars, common, inputs, ... }:
let let
libFixup = import ../../lib/darwin/libFixup.nix; libFixup = import ../../lib/darwin/libFixup.nix;
@ -74,6 +74,14 @@ in {
# Create /etc/zshrc that loads the nix-darwin environment. # Create /etc/zshrc that loads the nix-darwin environment.
programs.zsh.enableCompletion = false; # causing "insecure directories and files" error if user doesn't have configured zsh programs.zsh.enableCompletion = false; # causing "insecure directories and files" error if user doesn't have configured zsh
programs.spicetify = {
enable = true;
enabledExtensions = with spicePkgs.extensions; [
adblock
shuffle
];
};
# Set Git commit hash for darwin-version. # Set Git commit hash for darwin-version.
system.configurationRevision = vars.rev or null; system.configurationRevision = vars.rev or null;

View file

@ -30,11 +30,13 @@ in
} }
) pkgs pkgs-unstable; ) pkgs pkgs-unstable;
common = (mkCommon { inherit pkgs pkgs-unstable; }); common = (mkCommon { inherit pkgs pkgs-unstable; });
spicePkgs = inputs.spicetify-nix.legacyPackages.${system};
in in
nix-darwin.lib.darwinSystem { nix-darwin.lib.darwinSystem {
inherit system; inherit system;
specialArgs = { inherit inputs pkgs pkgs-unstable vars common; }; specialArgs = { inherit inputs pkgs pkgs-unstable spicePkgs vars common; };
modules = [ modules = [
inputs.spicetify-nix.nixosModules.default # Also works on nix-darwin thanks to it being nixosConfiguration replacement for macOS
./configuration.nix ./configuration.nix
]; ];
}; };
@ -57,11 +59,13 @@ in
} }
) pkgs pkgs-unstable; ) pkgs pkgs-unstable;
common = (mkCommon { inherit pkgs pkgs-unstable; }); common = (mkCommon { inherit pkgs pkgs-unstable; });
spicePkgs = inputs.spicetify-nix.legacyPackages.${system};
in in
nix-darwin.lib.darwinSystem { nix-darwin.lib.darwinSystem {
inherit system; inherit system;
specialArgs = { inherit inputs pkgs pkgs-unstable vars common; }; specialArgs = { inherit inputs pkgs pkgs-unstable spicePkgs vars common; };
modules = [ modules = [
inputs.spicetify-nix.nixosModules.default
./configuration.nix ./configuration.nix
]; ];
}; };

View file

@ -27,7 +27,7 @@ in
unstable = nixpkgs-unstable; unstable = nixpkgs-unstable;
extraOverlays = [ extraOverlays = [
inputs.firefox-darwin.overlay inputs.firefox-darwin.overlay
(mkBrew { inherit system; brew-api = inputs.brew-api; nixpkgs = nixpkgs-stable; }) (mkBrew { inherit system; inherit (inputs) brew-api; nixpkgs = nixpkgs-stable; })
]; ];
nur = nur; nur = nur;
} }