Flake attempt #30

This commit is contained in:
Javier Feliz 2025-09-07 20:16:41 -04:00
parent ffc240186d
commit a8a1022c77
4 changed files with 55 additions and 19 deletions

37
flake.lock generated
View File

@ -18,7 +18,41 @@
"type": "github" "type": "github"
} }
}, },
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1757256385,
"narHash": "sha256-WK7tOhWwr15mipcckhDg2no/eSpM1nIh4C9le8HgHhk=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f35703b412c67b48e97beb6e27a6ab96a084cd37",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1757068644,
"narHash": "sha256-NOrUtIhTkIIumj1E/Rsv1J37Yi3xGStISEo8tZm3KW4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8eb28adfa3dc4de28e792e3bf49fcf9007ca8ac9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1756787288, "lastModified": 1756787288,
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
@ -37,7 +71,8 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
} }
}, },
"systems": { "systems": {

View File

@ -4,6 +4,7 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
home-manager.url = "github:nix-community/home-manager";
}; };
outputs = outputs =
@ -11,14 +12,14 @@
self, self,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
home-manager,
}: }:
flake-utils.lib.eachDefaultSystem ( (flake-utils.lib.eachDefaultSystem (
system: system:
let let
# pkgs = nixpkgs.legacyPackages.${system}; # pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ self.overlay ];
}; };
in in
{ {
@ -93,12 +94,15 @@
adwaita-icon-theme adwaita-icon-theme
]; ];
}; };
overlays.default = final: prev: {
waycast = self.packages.${system}.default;
};
} }
); )) // {
homeManagerModules.default = { pkgs, ... }: import ./modules/home-manager/waycast.nix {
overlay = final: prev: { inherit pkgs;
waycast = self.packages.${final.system}.default; waycastPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
}; };
};
homeManagerModules.waycast = import ./modules/home-manager/waycast.nix;
} }

View File

@ -1,9 +1,5 @@
{ { pkgs, waycastPackage }:
config, { config, lib, ... }:
lib,
pkgs,
...
}:
with lib; with lib;
@ -20,7 +16,7 @@ in
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.waycast or (throw "waycast package not found in pkgs"); default = waycastPackage;
description = "The waycast package to use"; description = "The waycast package to use";
}; };
@ -73,8 +69,8 @@ in
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
xdg.configFile = mkMerge [ xdg.configFile = mkMerge [
(mkIf (cfg.config != { }) { (mkIf (cfg.settings != { }) {
"waycast/waycast.toml".source = toToml cfg.config; "waycast/waycast.toml".source = toToml cfg.settings;
}) })
(mkIf (cfg.css != null) { (mkIf (cfg.css != null) {

1
result Symbolic link
View File

@ -0,0 +1 @@
/nix/store/rvkvjz9b92dd4qx4l78q31bb18lflz70-waycast-0.0.1