aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/checks.nix31
-rw-r--r--nix/default.nix5
-rw-r--r--nix/mkHomeManagerConfiguration.nix28
-rw-r--r--nix/mkSystem.nix7
4 files changed, 32 insertions, 39 deletions
diff --git a/nix/checks.nix b/nix/checks.nix
deleted file mode 100644
index aadb170..0000000
--- a/nix/checks.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ pkgs, pre-commit-hooks, ... }:
-
-with pkgs;
-
-{
- pre-commit-check = pre-commit-hooks.lib.${system}.run {
- src = lib.cleanSource ../.;
- hooks = {
- nix-linter.enable = true;
- nixpkgs-fmt.enable = true;
- trailing-whitespace = {
- enable = true;
- entry =
- "${pkgs.python3Packages.pre-commit-hooks}/bin/trailing-whitespace-fixer";
- types = [ "text" ];
- };
- end-of-file-fixer = {
- enable = true;
- entry =
- "${pkgs.python3Packages.pre-commit-hooks}/bin/end-of-file-fixer";
- types = [ "text" ];
- };
- terraform-format = { enable = true; };
- shellcheck = {
- enable = true;
- files = "\\.sh$";
- types_or = [ "file" ];
- };
- };
- };
-}
diff --git a/nix/default.nix b/nix/default.nix
index 2dfd8a2..2e76200 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,5 +1,4 @@
-{ inputs }:
-
-{
+inputs: {
mkSystem = import ./mkSystem.nix inputs;
+ mkHomeManagerConfiguration = import ./mkHomeManagerConfiguration.nix inputs;
}
diff --git a/nix/mkHomeManagerConfiguration.nix b/nix/mkHomeManagerConfiguration.nix
new file mode 100644
index 0000000..bcf374a
--- /dev/null
+++ b/nix/mkHomeManagerConfiguration.nix
@@ -0,0 +1,28 @@
+inputs@{ self, ... }:
+{ system ? "x86_64-linux"
+, username ? "fcuny"
+, hostname
+, stateVersion ? "22.05"
+, extraModules ? [ ]
+,
+}:
+inputs.home-manager.lib.homeManagerConfiguration {
+ inherit system;
+ inherit username;
+ inherit stateVersion;
+
+ homeDirectory = "/home/${username}";
+
+ pkgs = import inputs.nixpkgs {
+ inherit system;
+ config.allowUnfree = true;
+ overlays = [
+ inputs.emacs-overlay.overlay
+ inputs.nur.overlay
+ inputs.rust.overlays.default
+ (final: prev: { tools = import "${self}/tools" { pkgs = prev; }; })
+ ];
+ };
+ configuration.imports =
+ [ "${self}/home" "${self}/hosts/${hostname}/home.nix" ];
+}
diff --git a/nix/mkSystem.nix b/nix/mkSystem.nix
index 1f7ccaf..00b5664 100644
--- a/nix/mkSystem.nix
+++ b/nix/mkSystem.nix
@@ -12,12 +12,9 @@ inputs.nixpkgs.lib.nixosSystem {
nixpkgs = {
config.allowUnfree = true;
overlays = [
- inputs.emacs-overlay.overlay
inputs.nur.overlay
- inputs.rust.overlay
- (final: prev: {
- tools = import "${self}/tools" { pkgs = prev; };
- })
+ inputs.rust.overlays.default
+ (final: prev: { tools = import "${self}/tools" { pkgs = prev; }; })
];
};
# Add each input as a registry