Move languages into the base module
This commit is contained in:
parent
9e4bc003cb
commit
8ded2f1513
112 changed files with 79 additions and 86 deletions
1
.envrc
1
.envrc
|
@ -1,3 +1,2 @@
|
||||||
watch_dir ./languages
|
|
||||||
watch_dir ./modules
|
watch_dir ./modules
|
||||||
use flake
|
use flake
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
inputs.home-manager.flakeModules.home-manager
|
inputs.home-manager.flakeModules.home-manager
|
||||||
./modules
|
./modules
|
||||||
./languages
|
|
||||||
];
|
];
|
||||||
flake = {
|
flake = {
|
||||||
# https://nix-community.github.io/home-manager/options.xhtml
|
# https://nix-community.github.io/home-manager/options.xhtml
|
||||||
|
|
|
@ -1,57 +1,4 @@
|
||||||
{ flake-parts-lib, inputs, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [ ./modules ];
|
||||||
inputs.treefmt-nix.flakeModule
|
|
||||||
inputs.git-hooks-nix.flakeModule
|
|
||||||
inputs.devshell.flakeModule
|
|
||||||
];
|
|
||||||
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
devshells.default = {
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
help = " update dependencies";
|
|
||||||
name = "update";
|
|
||||||
command = "${pkgs.lix}/bin/nix flake update";
|
|
||||||
category = " Flake";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
help = " reload direnv environment";
|
|
||||||
name = "reload";
|
|
||||||
command = "${pkgs.direnv}/bin/direnv reload";
|
|
||||||
category = " Flake";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
packages = [
|
|
||||||
pkgs.git
|
|
||||||
pkgs.jujutsu
|
|
||||||
pkgs.lix
|
|
||||||
pkgs.man
|
|
||||||
pkgs.uutils-coreutils-noprefix
|
|
||||||
];
|
|
||||||
devshell.startup = {
|
|
||||||
pre-commit.text = ''
|
|
||||||
${config.pre-commit.installationScript}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# https://flake.parts/options/git-hooks-nix.html
|
|
||||||
pre-commit.settings = {
|
|
||||||
hooks = {
|
|
||||||
treefmt = {
|
|
||||||
enable = true;
|
|
||||||
package = config.treefmt.build.wrapper;
|
|
||||||
};
|
|
||||||
check-merge-conflicts.enable = true;
|
|
||||||
check-symlinks.enable = true;
|
|
||||||
flake-checker.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# https://flake.parts/options/treefmt-nix.html
|
|
||||||
treefmt.projectRootFile = "flake.nix";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
57
modules/base/modules/base/default.nix
Normal file
57
modules/base/modules/base/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
{ flake-parts-lib, inputs, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
|
inputs.git-hooks-nix.flakeModule
|
||||||
|
inputs.devshell.flakeModule
|
||||||
|
];
|
||||||
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
devshells.default = {
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
help = " update dependencies";
|
||||||
|
name = "update";
|
||||||
|
command = "${pkgs.lix}/bin/nix flake update";
|
||||||
|
category = " Flake";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
help = " reload direnv environment";
|
||||||
|
name = "reload";
|
||||||
|
command = "${pkgs.direnv}/bin/direnv reload";
|
||||||
|
category = " Flake";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
packages = [
|
||||||
|
pkgs.git
|
||||||
|
pkgs.jujutsu
|
||||||
|
pkgs.lix
|
||||||
|
pkgs.man
|
||||||
|
pkgs.uutils-coreutils-noprefix
|
||||||
|
];
|
||||||
|
devshell.startup = {
|
||||||
|
pre-commit.text = ''
|
||||||
|
${config.pre-commit.installationScript}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# https://flake.parts/options/git-hooks-nix.html
|
||||||
|
pre-commit.settings = {
|
||||||
|
hooks = {
|
||||||
|
treefmt = {
|
||||||
|
enable = true;
|
||||||
|
package = config.treefmt.build.wrapper;
|
||||||
|
};
|
||||||
|
check-merge-conflicts.enable = true;
|
||||||
|
check-symlinks.enable = true;
|
||||||
|
flake-checker.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# https://flake.parts/options/treefmt-nix.html
|
||||||
|
treefmt.projectRootFile = "flake.nix";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
11
modules/base/modules/languages/default.nix
Normal file
11
modules/base/modules/languages/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{ ... }:
|
||||||
|
let
|
||||||
|
entries = builtins.attrNames (builtins.readDir ./.);
|
||||||
|
configs = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/default.nix")) entries;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../base
|
||||||
|
../helix
|
||||||
|
] ++ builtins.map (name: (./. + "/${name}")) configs;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue