Compare commits

..

No commits in common. "a827a3450135eb1dbc633dcda66b6f116497d327" and "b90be0acdf1d2bed1c361db89e9de430e4913be4" have entirely different histories.

7 changed files with 47 additions and 96 deletions

1
.envrc
View file

@ -6,4 +6,3 @@ 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
View file

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

21
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,21 @@
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,37 +69,12 @@
"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,28 +31,9 @@
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 = outputs = { self, futils, home-manager, nixpkgs, nur } @ inputs:
inputs @
{ self
, futils
, home-manager
, nixpkgs
, nur
, pre-commit-hooks
}:
let let
inherit (futils.lib) eachDefaultSystem; inherit (futils.lib) eachDefaultSystem;
@ -71,12 +52,12 @@
]; ];
} }
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
({ config, ... }: { {
home-manager.users.${config.my.username} = import ./home; home-manager.users.ambroisie = 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
@ -100,43 +81,28 @@
in in
eachDefaultSystem eachDefaultSystem
(system: (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in in
rec { rec {
apps = { apps = {
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; [
git-crypt
gitAndTools.pre-commit
gnupg
nixpkgs-fmt
];
};
buildInputs = with pkgs; [ packages = import ./pkgs { inherit pkgs; };
git-crypt }) // {
gitAndTools.pre-commit
gnupg
nixpkgs-fmt
];
inherit (self.checks.${system}.pre-commit) shellHook;
};
packages = import ./pkgs { inherit pkgs; };
}) // {
overlay = self.overlays.pkgs; overlay = self.overlays.pkgs;
overlays = import ./overlays // { overlays = import ./overlays // {

View file

@ -22,13 +22,5 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware = { hardware.cpu.intel.updateMicrocode = true;
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
{ config, lib, ... }: { lib, ... }:
let let
actualPath = [ "home-manager" "users" config.my.username "my" "home" ]; actualPath = [ "home-manager" "users" "ambroisie" "my" "home" ];
aliasPath = [ "my" "home" ]; aliasPath = [ "my" "home" ];
in in
{ {