Skip to content

Commit

Permalink
feat(nixosModules): add nixosProfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Sep 20, 2023
1 parent 16f60ba commit 02caac6
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 24 deletions.
2 changes: 0 additions & 2 deletions examples/nixos/__nixosProfiles/bootstrap.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
boot.__profiles__.systemd-boot.enable = true;
# config.boot.__profiles__.systemd-initrd.enable = true;
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
};
Expand Down
57 changes: 45 additions & 12 deletions examples/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,53 @@

homeModules = super.pops.homeModules.outputsForTarget.nixosModules;

homeProfiles = super.pops.homeProfiles.outputs;
homeProfiles = super.pops.homeProfiles.outputsForTarget;

nixosProfiles = super.pops.nixosProfiles.outputs;
nixosProfiles = super.pops.nixosProfiles.outputsForTarget;

nixosSuites =
let
customProfiles = self.nixosProfiles { };
customProfiles = {
nix =
(self.nixosProfiles.dmerge {
nix.extraOptions = ''
allowed-uris = https://github.com/
'';
}).presets.nix;
boot =
(self.nixosProfiles.dmerge {
# boot.__profiles__.systemd-initrd.enable = true;
boot.__profiles__.systemd-boot.enable = true;
}).presets.boot;
};
in
lib.flatten [
self.selfNixOSProfiles.bootstrap
self.nixosModules.boot

# self.nixosProfiles.default.presets.boot
customProfiles.boot

self.nixosModules.programs.git

# (
# {
# lib,
# config,
# options,
# ...
# }@args:
# {
# options = {
# __test__ = lib.mkOption {
# type = lib.types.attrs;
# default = ;
# };
# };
# }
# )

# --custom profiles
customProfiles.presets.nix
customProfiles.nix

(selfLib.mkHome
{
Expand All @@ -37,16 +69,17 @@

homeSuites =
let
customProfiles = self.homeProfiles {
presets.hyprland.default = {
wayland.windowManager.hyprland.__profiles__ = {
nvidia = true;
};
};
customProfiles = {
hyprland =
(self.homeProfiles.dmerge {
wayland.windowManager.hyprland.__profiles__ = {
nvidia = true;
};
}).presets.hyprland;
};
in
[
customProfiles.presets.hyprland.default
customProfiles.hyprland
# self.homeModules.wayland.windowManager.hyprland
];
}
6 changes: 3 additions & 3 deletions flake.lock

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

7 changes: 3 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
loadHomeProfiles = loadHomeModules.addLoadExtender {
src = ./nixos/homeProfiles;
loader = haumea.lib.loaders.scoped;
type = "default";
type = "nixosProfiles";
};
loadNixOSProfiles = loadNixOSModules.addLoadExtender {
loadNixOSProfiles = flops.lib.haumea.pops.default.setInit {
src = ./nixos/nixosProfiles;
loader = haumea.lib.loaders.scoped;
type = "default";
type = "nixosProfiles";
};
lib = flops.lib.haumea.pops.default.setInit {
src = ./lib;
Expand Down
2 changes: 1 addition & 1 deletion nixos/nixosProfiles/bootstrap.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[ ]
{ default = [ ]; }
4 changes: 4 additions & 0 deletions nixos/nixosProfiles/presets/boot.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
imports = [ POS.nixosModules.boot ];
boot.__profiles__.systemd-boot.enable = true;
}
5 changes: 3 additions & 2 deletions nixos/nixosProfiles/presets/nix.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_:
{ pkgs, ... }:
let
inherit (moduleArgs) pkgs;
in
{
nix = {
package = pkgs.nixUnstable;
Expand Down

0 comments on commit 02caac6

Please sign in to comment.