1
0
Fork 0

Compare commits

..

2 commits

Author SHA1 Message Date
dc57b47ab9
Simplify flake-parts modules 2025-07-14 01:43:58 -05:00
333f06a179
Move sops into separate module 2025-07-14 01:30:42 -05:00
13 changed files with 287 additions and 313 deletions

1
.envrc
View file

@ -1,3 +1,4 @@
watch_dir ./base watch_dir ./base
watch_dir ./sops
watch_file ./home-manager/default.nix watch_file ./home-manager/default.nix
use flake use flake

View file

@ -1,14 +1,13 @@
{ flake-parts-lib, inputs, ... }: { inputs, ... }:
{ {
imports = [ imports = [
inputs.treefmt-nix.flakeModule inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule inputs.git-hooks-nix.flakeModule
inputs.devshell.flakeModule inputs.devshell.flakeModule
]; ];
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
config = {
devshells.default = { devshells.default = {
commands = [ commands = [
{ {
@ -52,6 +51,4 @@
# https://flake.parts/options/treefmt-nix.html # https://flake.parts/options/treefmt-nix.html
treefmt.projectRootFile = "flake.nix"; treefmt.projectRootFile = "flake.nix";
}; };
}
);
} }

View file

@ -1,4 +1,4 @@
{ flake-parts-lib, ... }: { ... }:
let let
dictionary = [ dictionary = [
"Asahi" "Asahi"
@ -11,7 +11,7 @@ let
]; ];
in in
{ {
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ pkgs, ... }: { pkgs, ... }:
let let
tomlFormatter = pkgs.formats.toml { }; tomlFormatter = pkgs.formats.toml { };
@ -85,7 +85,6 @@ in
}; };
in in
{ {
config = {
helix.languages.language-server = { helix.languages.language-server = {
# https://ltex-plus.github.io/ltex-plus/supported-languages.html # https://ltex-plus.github.io/ltex-plus/supported-languages.html
ltex-ls-plus = { ltex-ls-plus = {
@ -146,6 +145,4 @@ in
# ''; # '';
}; };
}; };
}
);
} }

View file

@ -1,10 +1,9 @@
{ flake-parts-lib, ... }: { ... }:
{ {
imports = [ ../en-us ]; imports = [ ../en-us ];
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
config = {
helix.languages = { helix.languages = {
language = [ language = [
{ {
@ -41,6 +40,4 @@
}; };
pre-commit.settings.hooks.markdownlint.enable = true; pre-commit.settings.hooks.markdownlint.enable = true;
}; };
}
);
} }

View file

@ -1,7 +1,7 @@
{ flake-parts-lib, ... }: { ... }:
{ {
imports = [ ../en-us ]; imports = [ ../en-us ];
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
helix.languages = { helix.languages = {
@ -30,6 +30,5 @@
enable = true; enable = true;
strict = true; strict = true;
}; };
} };
);
} }

View file

@ -1,10 +1,9 @@
{ flake-parts-lib, ... }: { ... }:
{ {
imports = [ ../en-us ]; imports = [ ../en-us ];
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
config = {
helix.languages = { helix.languages = {
language = [ language = [
{ {
@ -30,6 +29,4 @@
treefmt.programs.taplo.enable = true; treefmt.programs.taplo.enable = true;
pre-commit.settings.hooks.check-toml.enable = true; pre-commit.settings.hooks.check-toml.enable = true;
}; };
}
);
} }

View file

@ -1,10 +1,9 @@
{ flake-parts-lib, ... }: { ... }:
{ {
imports = [ ../en-us ]; imports = [ ../en-us ];
options.perSystem = flake-parts-lib.mkPerSystemOption ( perSystem =
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
config = {
helix.languages = { helix.languages = {
language = [ language = [
{ {
@ -42,6 +41,4 @@
sort-simple-yaml.enable = true; sort-simple-yaml.enable = true;
}; };
}; };
}
);
} }

View file

@ -41,42 +41,15 @@
systems = [ "aarch64-linux" ]; systems = [ "aarch64-linux" ];
imports = [ imports = [
./base ./base
./sops
./home-manager ./home-manager
]; ];
perSystem = perSystem =
{ pkgs, system, ... }: { pkgs, system, ... }:
# let
# pkgs = import inputs.nixpkgs {
# inherit system;
# overlays = [
# inputs.nur.overlays.default
# inputs.nixgl.overlays.default
# ];
# };
# in
{ {
# _module.args.pkgs = pkgs;
# https://flake.parts/options/devshell.html # https://flake.parts/options/devshell.html
devshells.default = { devshells.default = {
commands = [ packages = [ pkgs.forgejo-cli ];
{
help = " generate age key";
name = "age-generate-key";
command = "${pkgs.uutils-coreutils-noprefix}/bin/mkdir -p ~/.config/sops/age && ${pkgs.age}/bin/age-keygen -o ~/.config/sops/age/keys.txt && ${pkgs.uutils-coreutils-noprefix}/bin/cat ~/.config/sops/age/keys.txt";
category = " SOPS";
}
{
help = " edit secrets.yaml";
name = "sops-edit";
command = "${pkgs.sops}/bin/sops edit ./home-manager/secrets/secrets.yaml";
category = " SOPS";
}
];
packages = [
pkgs.age
pkgs.forgejo-cli
pkgs.sops
];
devshell = { devshell = {
motd = '' motd = ''
{202} Nix Laptop Configuration{reset} {202} Nix Laptop Configuration{reset}

View file

@ -1,16 +1,26 @@
{ { inputs, withSystem, ... }:
flake-parts-lib,
inputs,
withSystem,
...
}:
{ {
imports = [ inputs.home-manager.flakeModules.home-manager ]; imports = [ inputs.home-manager.flakeModules.home-manager ];
options = { # https://nix-community.github.io/home-manager/options.xhtml
perSystem = flake-parts-lib.mkPerSystemOption ( flake.homeConfigurations = {
asahi = withSystem "aarch64-linux" (
{ pkgs, ... }:
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs pkgs; };
modules = [
{ nixpkgs.overlays = [ inputs.nur.overlays.default ]; }
inputs.lix-module.nixosModules.default
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeModules.stylix
inputs.catppuccin.homeModules.catppuccin
./home.nix
];
}
);
};
perSystem =
{ config, system, ... }: { config, system, ... }:
{
config =
let let
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit system; inherit system;
@ -48,27 +58,4 @@
pre-commit.settings.excludes = [ "home-manager/vencord.nix" ]; pre-commit.settings.excludes = [ "home-manager/vencord.nix" ];
treefmt.settings.global.excludes = [ "home-manager/vencord.nix" ]; treefmt.settings.global.excludes = [ "home-manager/vencord.nix" ];
}; };
}
);
};
config = {
# https://nix-community.github.io/home-manager/options.xhtml
flake.homeConfigurations = {
asahi = withSystem "aarch64-linux" (
{ pkgs, ... }:
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs pkgs; };
modules = [
{ nixpkgs.overlays = [ inputs.nur.overlays.default ]; }
inputs.lix-module.nixosModules.default
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeModules.stylix
inputs.catppuccin.homeModules.catppuccin
./home.nix
];
}
);
};
};
} }

View file

@ -18,7 +18,7 @@ in
secrets = { secrets = {
openrouter_api_key = { }; openrouter_api_key = { };
}; };
defaultSopsFile = ./secrets/secrets.yaml; defaultSopsFile = ../sops/secrets.yaml;
age.keyFile = /home/${username}/.config/sops/age/keys.txt; age.keyFile = /home/${username}/.config/sops/age/keys.txt;
}; };
# https://nix.catppuccin.com/search/rolling/ # https://nix.catppuccin.com/search/rolling/

29
sops/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ ... }:
{
perSystem =
{ pkgs, ... }:
{
config = {
devshells.default = {
commands = [
{
help = " generate age key";
name = "age-generate-key";
command = "${pkgs.uutils-coreutils-noprefix}/bin/mkdir -p ~/.config/sops/age && ${pkgs.age}/bin/age-keygen -o ~/.config/sops/age/keys.txt && ${pkgs.uutils-coreutils-noprefix}/bin/cat ~/.config/sops/age/keys.txt";
category = " SOPS";
}
{
help = " edit secrets.yaml";
name = "sops-edit";
command = "${pkgs.sops}/bin/sops edit ./sops/secrets.yaml";
category = " SOPS";
}
];
packages = [
pkgs.age
pkgs.sops
];
};
};
};
}