1
0
Fork 0

Simplify flake-parts modules

This commit is contained in:
Ethan Reece 2025-07-14 01:43:58 -05:00
parent 333f06a179
commit dc57b47ab9
Signed by: me
GPG key ID: DD8CE04D5D8FF832
9 changed files with 281 additions and 312 deletions

1
.envrc
View file

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

View file

@ -1,14 +1,13 @@
{ flake-parts-lib, inputs, ... }:
{ inputs, ... }:
{
imports = [
inputs.treefmt-nix.flakeModule
inputs.git-hooks-nix.flakeModule
inputs.devshell.flakeModule
];
options.perSystem = flake-parts-lib.mkPerSystemOption (
perSystem =
{ config, pkgs, ... }:
{
config = {
devshells.default = {
commands = [
{
@ -53,5 +52,3 @@
treefmt.projectRootFile = "flake.nix";
};
}
);
}

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +1,9 @@
{ flake-parts-lib, ... }:
{ ... }:
{
imports = [ ../en-us ];
options.perSystem = flake-parts-lib.mkPerSystemOption (
perSystem =
{ config, pkgs, ... }:
{
config = {
helix.languages = {
language = [
{
@ -43,5 +42,3 @@
};
};
}
);
}

View file

@ -1,16 +1,26 @@
{
flake-parts-lib,
inputs,
withSystem,
...
}:
{ inputs, withSystem, ... }:
{
imports = [ inputs.home-manager.flakeModules.home-manager ];
options = {
perSystem = flake-parts-lib.mkPerSystemOption (
# 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
];
}
);
};
perSystem =
{ config, system, ... }:
{
config =
let
pkgs = import inputs.nixpkgs {
inherit system;
@ -49,26 +59,3 @@
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

@ -1,8 +1,7 @@
{ flake-parts-lib, ... }:
{ ... }:
{
options = {
perSystem = flake-parts-lib.mkPerSystemOption (
{ config, pkgs, ... }:
perSystem =
{ pkgs, ... }:
{
config = {
devshells.default = {
@ -26,7 +25,5 @@
];
};
};
}
);
};
}