Skip to content

Commit

Permalink
Merge pull request #26 from datsfilipe/zellij-swtich-flake
Browse files Browse the repository at this point in the history
refactor: add zellij-switch from it's own flake
  • Loading branch information
datsfilipe authored Jan 10, 2025
2 parents 73ad1f4 + ab1cc6c commit e55e705
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 67 deletions.
91 changes: 82 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
inputs.nixpkgs.follows = "nixpkgs";
url = "github:Mic92/sops-nix/master";
};
zellij-switch = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:datsfilipe/zellij-switch/flake";
};
datsnvim = {
flake = false;
url = "git+file:///home/dtsf/.dotfiles/home/base/tui/editors/neovim/conf?shallow=1";
Expand Down
2 changes: 1 addition & 1 deletion home/base/tui/zellij/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{mypkgs, config, lib, ...}: let
{mypkgs, zellij-switch, config, lib, ...}: let
shellAliases = {
"zj" = "zellij";
};
Expand Down
2 changes: 1 addition & 1 deletion home/linux/base/scripts/conf
13 changes: 9 additions & 4 deletions lib/spec.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ in {
};

testScanPaths = {
expr = mylib.file.scanPaths ../modules/nupkgs;
expr = mylib.file.scanPaths ../modules;
expected = [
../modules/nupkgs/devtunnel-cli
../modules/nupkgs/home.nix
../modules/nupkgs/zellij-switch
../modules/base.nix
../modules/colorscheme
../modules/conf
../modules/devenvs
../modules/nixos
../modules/nupkgs
../modules/secrets
../modules/wallpaper
];
};

Expand Down
28 changes: 16 additions & 12 deletions modules/nupkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{ lib, pkgs, mylib, ... }: let
{ lib, pkgs, mylib, zellij-switch, ... }: let
packageFiles = lib.filter
(path: !lib.strings.hasPrefix (toString ./overlays) (toString path))
(mylib.file.scanPaths ./.);

pkgsWithOverlays = pkgs.extend zellij-switch.overlays.default;

packages = builtins.listToAttrs (
map
(file:
let
name = lib.strings.removeSuffix ".nix" (baseNameOf file);
in {
inherit name;
value = pkgs.callPackage file {};
}
)
(mylib.file.scanPaths ./.)
);
map
(file: {
name = lib.strings.removeSuffix ".nix" (baseNameOf file);
value = pkgsWithOverlays.callPackage file {};
})
packageFiles
) // {
inherit (pkgsWithOverlays) zellij-switch;
};
in
packages
5 changes: 0 additions & 5 deletions modules/nupkgs/zellij-switch/conf/source.json

This file was deleted.

21 changes: 0 additions & 21 deletions modules/nupkgs/zellij-switch/conf/update.sh

This file was deleted.

11 changes: 0 additions & 11 deletions modules/nupkgs/zellij-switch/default.nix

This file was deleted.

4 changes: 2 additions & 2 deletions outputs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
inherit (inputs.nixpkgs) lib;
myvars = import ../vars;
mylib = import ../lib {inherit lib; inherit (builtins) builtins;};
genMypkgs = system: import ../modules/nupkgs {
genMypkgs = system: import ../modules/nupkgs (inputs // {
inherit lib mylib;
pkgs = import inputs.nixpkgs {
inherit system;
Expand All @@ -15,7 +15,7 @@
"openssl-1.1.1w"
];
};
};
});

genSpecialArgs = system:
let
Expand Down
1 change: 1 addition & 0 deletions templates/flake.template.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in genFlake ./flake.template.nix
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
zellij-switch = (ext "github:datsfilipe/zellij-switch/flake");
home-manager = (ext "github:nix-community/home-manager/master");
sops-nix = (ext "github:Mic92/sops-nix/master");
datsnvim = (local ../home/base/tui/editors/neovim/conf);
Expand Down

0 comments on commit e55e705

Please sign in to comment.