Skip to content

Commit

Permalink
refactor: done the minor version
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Sep 20, 2023
1 parent eb0ebe9 commit e8a1db2
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 89 deletions.
16 changes: 16 additions & 0 deletions examples/nixos/_test.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(
{
lib,
config,
options,
...
}@args:
{
options = {
__test__ = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}
)
107 changes: 25 additions & 82 deletions examples/nixos/default.nix
Original file line number Diff line number Diff line change
@@ -1,92 +1,35 @@
let
pops = lib.mapAttrs (_: v: v.outputsForTarget) (
pops = lib.mapAttrs (_: v: v.exports) (
lib.removeAttrs super.pops [ "inputs__" ]
);
in
{
nixosSuites =
let
customProfiles = {
nix =
(pops.nixosProfiles.dmerge {
nix.extraOptions = ''
allowed-uris = https://github.com/
'';
})
[
"presets"
"nix"
];
boot =
(pops.nixosProfiles.dmerge {
# boot.__profiles__.systemd-initrd.enable = true;
boot.__profiles__.systemd-boot.enable = true;
})
[
"presets"
"boot"
];
};
in
lib.flatten [
pops.selfNixOSProfiles.default.bootstrap
nixosSuites = lib.flatten [
pops.selfNixOSProfiles.default.bootstrap

# self.nixosProfiles.default.presets.boot
customProfiles.boot
# self.nixosProfiles.default.presets.boot
pops.nixosModules.default.programs.git

pops.nixosModules.default.programs.git
# --custom profiles
pops.nixosProfiles.customProfiles.nix
pops.nixosProfiles.customProfiles.boot

# (
# {
# lib,
# config,
# options,
# ...
# }@args:
# {
# options = {
# __test__ = lib.mkOption {
# type = lib.types.attrs;
# default = ;
# };
# };
# }
# )
(selfLib.mkHome
{
admin = {
uid = 1000;
description = "default manager";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
"zsh"
self.homeSuites
)
];

# --custom profiles
customProfiles.nix

(selfLib.mkHome
{
admin = {
uid = 1000;
description = "default manager";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
"zsh"
self.homeSuites
)
];

homeSuites =
let
customProfiles = {
hyprland =
(pops.homeProfiles.dmerge {
wayland.windowManager.hyprland.__profiles__ = {
nvidia = true;
};
})
[
"presets"
"hyprland"
];
};
in
[
customProfiles.hyprland
# self.homeModules.wayland.windowManager.hyprland
];
homeSuites = [
pops.homeProfiles.customProfiles.hyprland
# self.homeModules.wayland.windowManager.hyprland
];
}
20 changes: 19 additions & 1 deletion examples/nixos/pops/homeModules.nix
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
loadHomeModules.addLoadExtender { inputs = super.inputs__.outputs // { }; }
(loadHomeModules.addLoadExtender { inputs = super.inputs__.outputs // { }; })
.addExporters
[
(POP.extendPop flops.haumea.pops.exporter (
self: super: {
exports.customModules.git =
self.outputsForTarget.dmerge
{
enable = false;
customList = with dmerge; append [ "1" ];
imports = with dmerge; append [ ];
}
[
"services"
"openssh"
];
}
))
]
23 changes: 21 additions & 2 deletions examples/nixos/pops/homeProfiles.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
loadHomeProfiles.addLoadExtender {
(loadHomeProfiles.addLoadExtender {
inputs = super.inputs__.outputs // {
POS = {
homeModules = super.homeModules.outputsForTarget.nixosModules;
};
};
}
}).addExporters
[
(POP.extendPop flops.haumea.pops.exporter (
self: super: {
exports.customProfiles = {
hyprland =
self.outputsForTarget.dmerge
{
wayland.windowManager.hyprland.__profiles__ = {
nvidia = true;
};
}
[
"presets"
"hyprland"
];
};
}
))
]
6 changes: 6 additions & 0 deletions examples/nixos/pops/nixosModules.nix
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
(loadNixOSModules.addLoadExtender { inputs = super.inputs__.outputs // { }; })
.addExporters
[
(POP.extendPop flops.haumea.pops.exporter (
self: super: { exports.customModules = { }; }
))
]
32 changes: 30 additions & 2 deletions examples/nixos/pops/nixosProfiles.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
loadNixOSProfiles.addLoadExtender {
(loadNixOSProfiles.addLoadExtender {
inputs = super.inputs__.outputs // {
POS = {
nixosModules = super.nixosModules.outputsForTarget.nixosModules;
};
};
}
}).addExporters
[
(POP.extendPop flops.haumea.pops.exporter (
self: super: {
exports.customProfiles = {
nix =
self.outputsForTarget.dmerge
{
nix.extraOptions = ''
allowed-uris = https://github.com/
'';
}
[
"presets"
"nix"
];
boot =
(self.outputsForTarget.dmerge {
# boot.__profiles__.systemd-initrd.enable = true;
boot.__profiles__.systemd-boot.enable = true;
})
[
"presets"
"boot"
];
};
}
))
]
5 changes: 3 additions & 2 deletions examples/nixos/pops/selfNixOSProfiles.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
super.nixosProfiles.addLoadExtender {
(super.nixosProfiles.addLoadExtender {
src = ../__nixosProfiles;
loader = haumea.loaders.scoped;
type = "nixosProfiles";
Expand All @@ -7,4 +7,5 @@ super.nixosProfiles.addLoadExtender {
nixosProfiles = super.nixosProfiles.outputsForTarget.nixosProfiles;
};
};
}
}).addExporters
[ (POP.extendPop flops.haumea.pops.exporter (self: super: { })) ]
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
lib = nixpkgs.lib // builtins;
flops = flops.lib;
haumea = flops.inputs.haumea.lib;
dmerge = flops.inputs.dmerge;
POP = POP.lib;
selfLib = lib.outputsForTarget.default;
};
Expand Down

0 comments on commit e8a1db2

Please sign in to comment.