summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/darwin/base/default.nix1
-rw-r--r--modules/darwin/default.nix13
-rw-r--r--modules/default.nix8
-rw-r--r--modules/flake/default.nix12
-rw-r--r--modules/flake/map-configs.nix191
-rw-r--r--modules/home/default.nix5
-rw-r--r--modules/home/riff.nix49
-rw-r--r--modules/nixos/archetypes/personal.nix7
-rw-r--r--modules/nixos/archetypes/server.nix7
-rw-r--r--modules/nixos/base/default.nix1
-rw-r--r--modules/nixos/default.nix15
-rw-r--r--modules/nixos/traits/locale.nix4
-rw-r--r--modules/shared/traits/locale.nix4
13 files changed, 23 insertions, 294 deletions
diff --git a/modules/darwin/base/default.nix b/modules/darwin/base/default.nix
index e9ab743..7e6f3bd 100644
--- a/modules/darwin/base/default.nix
+++ b/modules/darwin/base/default.nix
@@ -4,7 +4,6 @@ let
in
{
imports = [
- ../../shared
./programs.nix
];
diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix
index 97f25d5..e19f29a 100644
--- a/modules/darwin/default.nix
+++ b/modules/darwin/default.nix
@@ -1,8 +1,9 @@
{
- flake.darwinModules = {
- archetypes = ./archetypes;
- base = ./base;
- desktop = ./desktop;
- traits = ./traits;
- };
+ imports = [
+ ../shared
+ ./archetypes
+ ./base
+ ./desktop
+ ./traits
+ ];
}
diff --git a/modules/default.nix b/modules/default.nix
deleted file mode 100644
index a91a36b..0000000
--- a/modules/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- imports = [
- ./darwin
- ./home
- ./nixos
- ./flake
- ];
-}
diff --git a/modules/flake/default.nix b/modules/flake/default.nix
deleted file mode 100644
index d06026d..0000000
--- a/modules/flake/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-let
- flakeModules = {
- map-configs = ./map-configs.nix;
- };
-in
-{
- imports = [ flakeModules.map-configs ];
-
- flake = {
- inherit flakeModules;
- };
-}
diff --git a/modules/flake/map-configs.nix b/modules/flake/map-configs.nix
deleted file mode 100644
index e7733f3..0000000
--- a/modules/flake/map-configs.nix
+++ /dev/null
@@ -1,191 +0,0 @@
-{
- config,
- lib,
- withSystem,
- inputs,
- self,
- ...
-}:
-let
- nixosSystem =
- {
- nixpkgs,
- modules,
- specialArgs,
- ...
- }@args:
- nixpkgs.lib.nixosSystem (
- lib.removeAttrs args [ "nixpkgs" ]
- // {
- modules = modules ++ builtins.attrValues (self.nixosModules or [ ]);
- specialArgs = specialArgs // {
- inherit inputs;
- };
- }
- );
-
- darwinSystem =
- {
- nix-darwin,
- modules,
- specialArgs,
- ...
- }@args:
- nix-darwin.lib.darwinSystem (
- lib.removeAttrs args [ "nix-darwin" ]
- // {
- modules = modules ++ builtins.attrValues (self.darwinModules or { });
- specialArgs = specialArgs // {
- inherit inputs;
- };
- }
- );
-
- homeManagerConfiguration =
- {
- modules,
- extraSpecialArgs,
- ...
- }@args:
- inputs.home-manager.lib.homeManagerConfiguration (
- args
- // {
- modules = modules ++ builtins.attrValues (self.homeModules or self.homeManagerModules or { });
- extraSpecialArgs = extraSpecialArgs // {
- inherit inputs;
- };
- }
- );
-
- modulesOption = lib.mkOption {
- type = lib.types.listOf lib.types.unspecified;
- default = [ ];
- description = ''
- List of modules to use in the configuration
- '';
- };
-
- specialArgsOption = lib.mkOption {
- type = lib.types.lazyAttrsOf lib.types.raw;
- default = { };
- description = ''
- Extra arguments to pass to the configuration
- '';
- };
-
- freeformType = lib.types.attrsOf lib.types.raw;
-
- nixosConfigurationSubmodule = {
- inherit freeformType;
-
- options = {
- nixpkgs = lib.mkOption {
- type = lib.types.lazyAttrsOf lib.types.raw;
- default = inputs.nixpkgs or (throw "Could not find flake input `nixpkgs`");
- description = ''
- Instance of nixpkgs to use `lib.nixosSystem` from
- '';
- example = lib.literalExpression ''
- inputs.nixpkgs-stable
- '';
- };
-
- modules = modulesOption;
- specialArgs = specialArgsOption;
- };
- };
-
- homeConfigurationSubmodule = {
- inherit freeformType;
-
- options = {
- pkgs = lib.mkOption {
- type = lib.types.lazyAttrsOf lib.types.raw;
- default = withSystem "x86_64-linux" ({ pkgs, ... }: pkgs);
- description = ''
- Instance of nixpkgs to use with the configuration
- '';
- example = lib.literalExpression ''
- inputs.nixpkgs.legacyPackages.aarch64-darwin
- '';
- };
-
- modules = modulesOption;
- extraSpecialArgs = specialArgsOption;
- };
- };
-
- darwinConfigurationSubmodule = {
- inherit freeformType;
-
- options = {
- nix-darwin = lib.mkOption {
- type = lib.types.lazyAttrsOf lib.types.raw;
- default =
- inputs.nix-darwin or inputs.darwin
- or (throw "Could not find flake input `nixpkgs` or `nix-darwin`");
- description = ''
- Instance of nix-darwin to use `lib.nix-darwin` from
- '';
- };
-
- modules = modulesOption;
- specialArgs = specialArgsOption;
- };
- };
-in
-
-{
- options = {
- nixosConfigurations = lib.mkOption {
- type = lib.types.lazyAttrsOf (lib.types.submodule nixosConfigurationSubmodule);
- default = { };
- apply = lib.mapAttrs (lib.const nixosSystem);
- description = ''
- Map of configuration names and arguments to `nixosSystem`
- '';
- example = lib.literalExpression ''
- {
- my-machine = { modules = [ ./configuration.nix ]; };
- }
- '';
- };
-
- homeConfigurations = lib.mkOption {
- type = lib.types.lazyAttrsOf (lib.types.submodule homeConfigurationSubmodule);
- default = { };
- apply = lib.mapAttrs (lib.const homeManagerConfiguration);
- description = ''
- Map of configuration names and arguments to `homeManagerConfiguration`
- '';
- example = lib.literalExpression ''
- {
- me = { pkgs = nixpkgs.legacyPackages.x86_64-linux; };
- }
- '';
- };
-
- darwinConfigurations = lib.mkOption {
- type = lib.types.lazyAttrsOf (lib.types.submodule darwinConfigurationSubmodule);
- default = { };
- apply = lib.mapAttrs (lib.const darwinSystem);
- description = ''
- Map of configuration names and arguments to `darwinSystem`
- '';
- example = lib.literalExpression ''
- {
- my-mac = { modules = [ ./darwin-configuration.nix ]; };
- }
- '';
- };
- };
-
- config.flake = {
- inherit (config) nixosConfigurations homeConfigurations darwinConfigurations;
- /*
- nixosConfigurations = lib.mapAttrs (lib.const nixosSystem) config.nixosConfigurations;
- homeConfigurations = lib.mapAttrs (lib.const homeManagerConfiguration) config.homeConfigurations;
- darwinConfigurations = lib.mapAttrs (lib.const darwinSystem) config.darwinConfigurations;
- */
- };
-}
diff --git a/modules/home/default.nix b/modules/home/default.nix
deleted file mode 100644
index 408e172..0000000
--- a/modules/home/default.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- flake.homeModules = {
- riff = ./riff.nix;
- };
-}
diff --git a/modules/home/riff.nix b/modules/home/riff.nix
deleted file mode 100644
index 3a3e748..0000000
--- a/modules/home/riff.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-# TODO: Upstream this
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.programs.git.riff;
- cfg' = config.programs.git;
-
- exe = baseNameOf (lib.getExe cfg.package);
-in
-{
- options.programs.git.riff = {
- enable = lib.mkEnableOption "diff filtering through riff";
- package = lib.mkPackageOption pkgs "riffdiff" { };
- };
-
- config = lib.mkIf cfg.enable {
- assertions = [
- {
- assertion =
- let
- enabled = [
- cfg'.delta.enable
- cfg'.diff-so-fancy.enable
- cfg'.difftastic.enable
- cfg.enable
- ];
- in
- lib.count lib.id enabled <= 1;
- message = "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' or `programs.git.riff.enable` can be set to true at the same time.";
- }
- ];
-
- home.packages = [ cfg.package ];
-
- programs.git.iniContent = {
- pager = {
- diff = exe;
- log = exe;
- show = exe;
- };
-
- interactive.diffFilter = exe + " --color=on";
- };
- };
-}
diff --git a/modules/nixos/archetypes/personal.nix b/modules/nixos/archetypes/personal.nix
index 1fa2f98..4200269 100644
--- a/modules/nixos/archetypes/personal.nix
+++ b/modules/nixos/archetypes/personal.nix
@@ -4,7 +4,7 @@ let
in
{
options.archetypes = {
- personal.enable = lib.mkEnableOption "the \"Personal\" archetype";
+ personal.enable = lib.mkEnableOption "the Personal archetype";
};
config = lib.mkIf cfg.enable {
@@ -13,11 +13,6 @@ in
traits = {
home-manager.enable = true;
- locale = {
- en_US.enable = true;
- US-east.enable = true;
- };
-
secrets.enable = true;
tailscale.enable = true;
diff --git a/modules/nixos/archetypes/server.nix b/modules/nixos/archetypes/server.nix
index 3a057d1..4dfbf9e 100644
--- a/modules/nixos/archetypes/server.nix
+++ b/modules/nixos/archetypes/server.nix
@@ -4,7 +4,7 @@ let
in
{
options.archetypes = {
- server.enable = lib.mkEnableOption "the \"Server\" archetype";
+ server.enable = lib.mkEnableOption "the Server archetype";
};
config = lib.mkIf cfg.enable {
@@ -25,11 +25,6 @@ in
traits = {
autoUpgrade.enable = true;
- locale = {
- en_US.enable = true;
- US-east.enable = true;
- };
-
secrets.enable = true;
tailscale = {
diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix
index 30e75d9..3a6412e 100644
--- a/modules/nixos/base/default.nix
+++ b/modules/nixos/base/default.nix
@@ -9,7 +9,6 @@ let
in
{
imports = [
- ../../shared
./networking.nix
./nix.nix
./programs.nix
diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix
index b0e3664..acc9d59 100644
--- a/modules/nixos/default.nix
+++ b/modules/nixos/default.nix
@@ -1,9 +1,10 @@
{
- flake.nixosModules = {
- archetypes = ./archetypes;
- base = ./base;
- desktop = ./desktop;
- server = ./server;
- traits = ./traits;
- };
+ imports = [
+ ../shared
+ ./archetypes
+ ./base
+ ./desktop
+ ./server
+ ./traits
+ ];
}
diff --git a/modules/nixos/traits/locale.nix b/modules/nixos/traits/locale.nix
index bd30819..aa103e2 100644
--- a/modules/nixos/traits/locale.nix
+++ b/modules/nixos/traits/locale.nix
@@ -5,7 +5,9 @@ in
{
options.traits.locale = {
en_US = {
- enable = lib.mkEnableOption "en_US locale";
+ enable = lib.mkEnableOption "en_US locale" // {
+ default = true;
+ };
};
};
diff --git a/modules/shared/traits/locale.nix b/modules/shared/traits/locale.nix
index a260988..3d0973c 100644
--- a/modules/shared/traits/locale.nix
+++ b/modules/shared/traits/locale.nix
@@ -5,7 +5,9 @@ in
{
options.traits.locale = {
US-east = {
- enable = lib.mkEnableOption "eastern United States locale";
+ enable = lib.mkEnableOption "eastern United States locale" // {
+ default = true;
+ };
};
};