Compare commits

..

7 commits

Author SHA1 Message Date
Bruno BELANYI a827a34501 git: ignore generated pre-commit configuration
All checks were successful
continuous-integration/drone/push Build is passing
2021-05-31 23:06:37 +02:00
Bruno BELANYI 610b0f2f4b nix: evaluate shell hooks
This activates the pre-commit-hook configuration.
2021-05-31 23:06:20 +02:00
Bruno BELANYI 59cb038045 flake: add pre-commit-hooks
Instead of havin the tool manage versions, use a pinned version.
2021-05-31 23:04:08 +02:00
Bruno BELANYI 15db81eb3b flake: change format 2021-05-31 23:02:32 +02:00
Bruno BELANYI 24efa3edca machines: aramis: hardware: enable trackpoint 2021-05-31 20:30:36 +02:00
Bruno BELANYI 2fe4f1faad modules: home: use 'username' config value 2021-05-30 01:31:05 +02:00
Bruno BELANYI 4f1f687eea flake: use 'username' config value 2021-05-30 01:20:14 +02:00
7 changed files with 96 additions and 47 deletions

1
.envrc
View file

@ -6,3 +6,4 @@ use_flake() {
ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation
use flake use flake
eval "$shellHooks"

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.pre-commit-config.yaml
.pre-commit-config.yaml

View file

@ -1,21 +0,0 @@
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: 'v2.3.0'
hooks:
- id: 'trailing-whitespace'
- id: 'end-of-file-fixer'
- id: 'check-yaml'
- id: 'check-added-large-files'
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
rev: '2.1.4'
hooks:
- id: 'forbid-binary'
- repo: 'local'
hooks:
- id: 'nixpkgs-fmt'
name: 'nixpkgs-fmt'
description: 'Format nix code with nixpkgs-fmt'
entry: 'nixpkgs-fmt'
language: 'system'
files: '\.nix$'
always_run: true

View file

@ -69,12 +69,37 @@
"type": "github" "type": "github"
} }
}, },
"pre-commit-hooks": {
"inputs": {
"flake-utils": [
"futils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1621411868,
"narHash": "sha256-R+7OQ2JYFCb3E7Jl7LhRifzMVCR6Gl8R98zYsNhZtJ8=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2e7fac06108b4fc81f5ff9ed9a02bc4f6ede7001",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "master",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"futils": "futils", "futils": "futils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur" "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks"
} }
} }
}, },

View file

@ -31,9 +31,28 @@
repo = "NUR"; repo = "NUR";
ref = "master"; ref = "master";
}; };
pre-commit-hooks = {
type = "github";
owner = "cachix";
repo = "pre-commit-hooks.nix";
ref = "master";
inputs = {
flake-utils.follows = "futils";
nixpkgs.follows = "nixpkgs";
};
};
}; };
outputs = { self, futils, home-manager, nixpkgs, nur } @ inputs: outputs =
inputs @
{ self
, futils
, home-manager
, nixpkgs
, nur
, pre-commit-hooks
}:
let let
inherit (futils.lib) eachDefaultSystem; inherit (futils.lib) eachDefaultSystem;
@ -52,12 +71,12 @@
]; ];
} }
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ ({ config, ... }: {
home-manager.users.ambroisie = import ./home; home-manager.users.${config.my.username} = import ./home;
# Nix Flakes compatibility # Nix Flakes compatibility
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
} })
# Include generic settings # Include generic settings
./modules ./modules
# Include bundles of settings # Include bundles of settings
@ -89,16 +108,31 @@
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; }; diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
}; };
checks = {
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt = {
enable = true;
};
};
};
};
defaultApp = apps.diff-flake; defaultApp = apps.diff-flake;
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
name = "NixOS-config"; name = "NixOS-config";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
git-crypt git-crypt
gitAndTools.pre-commit gitAndTools.pre-commit
gnupg gnupg
nixpkgs-fmt nixpkgs-fmt
]; ];
inherit (self.checks.${system}.pre-commit) shellHook;
}; };
packages = import ./pkgs { inherit pkgs; }; packages = import ./pkgs { inherit pkgs; };

View file

@ -22,5 +22,13 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = true; hardware = {
cpu.intel.updateMicrocode = true;
trackpoint = {
enable = true;
emulateWheel = true; # Holding middle buttons allows scrolling
};
};
} }

View file

@ -1,7 +1,7 @@
# Simplify setting home options # Simplify setting home options
{ lib, ... }: { config, lib, ... }:
let let
actualPath = [ "home-manager" "users" "ambroisie" "my" "home" ]; actualPath = [ "home-manager" "users" config.my.username "my" "home" ];
aliasPath = [ "my" "home" ]; aliasPath = [ "my" "home" ];
in in
{ {