From f48485cf90008b53c1e969bc9349ecaeaac938e1 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Thu, 14 Nov 2024 21:59:08 -0800 Subject: [PATCH] WIP!!!!!!! --- flake.nix | 18 ++++---- homes/x86_64-linux/marley@nyx/default.nix | 4 ++ lib/module/default.nix | 51 +++++++++++++++++++++++ modules/home/me/default.nix | 4 ++ 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 homes/x86_64-linux/marley@nyx/default.nix create mode 100644 lib/module/default.nix create mode 100644 modules/home/me/default.nix diff --git a/flake.nix b/flake.nix index 22ca3de..cfa3372 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,17 @@ { description = "marleyOS"; - outputs = inputs: inputs.snowfall-lib.mkFlake { - inherit inputs; - src = ./.; + outputs = + inputs: + inputs.snowfall-lib.mkFlake { + inherit inputs; + src = ./.; - snowfall = { - namespace = "marleyos"; - title = "marleyOS"; - } - }; + snowfall = { + namespace = "marleyos"; + title = "marleyOS"; + }; + }; old = { self, ... }@inputs: diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix new file mode 100644 index 0000000..40a51d2 --- /dev/null +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + home.stateVersion = "24.05"; +} diff --git a/lib/module/default.nix b/lib/module/default.nix new file mode 100644 index 0000000..15a46ec --- /dev/null +++ b/lib/module/default.nix @@ -0,0 +1,51 @@ +{ lib, ... }: +with lib; +rec { + ## Create a NixOS module option. + ## + ## ```nix + ## lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option." + ## ``` + ## + #@ Type -> Any -> String + mkOpt = + type: default: description: + mkOption { + inherit + type + default + description + ; + }; + + ## Create a boolean NixOS module option. + ## + ## ```nix + ## lib.mkBoolOpt true "Description of my option." + ## ``` + ## + #@ Type -> Any -> String + mkBoolOpt = mkOpt types.bool; + + enabled = { + ## Quickly enable an option. + ## + ## ```nix + ## services.nginx = enabled; + ## ``` + ## + #@ true + enable = true; + }; + + disabled = { + ## Quickly disable an option. + ## + ## ```nix + ## services.nginx = enabled; + ## ``` + ## + #@ false + enable = false; + }; +} diff --git a/modules/home/me/default.nix b/modules/home/me/default.nix new file mode 100644 index 0000000..5e946b8 --- /dev/null +++ b/modules/home/me/default.nix @@ -0,0 +1,4 @@ +{ namespace, lib, ... }: +{ + +}