2021-02-05 16:25:39 +01:00
|
|
|
{
|
2021-03-07 19:30:33 +01:00
|
|
|
description = "NixOS configuration with flakes";
|
2021-02-05 16:25:39 +01:00
|
|
|
inputs = {
|
2021-09-25 13:30:51 +02:00
|
|
|
agenix = {
|
|
|
|
type = "github";
|
|
|
|
owner = "ryantm";
|
|
|
|
repo = "agenix";
|
2021-11-23 17:08:46 +01:00
|
|
|
ref = "main";
|
2021-09-25 13:30:51 +02:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-25 17:50:57 +02:00
|
|
|
futils = {
|
|
|
|
type = "github";
|
|
|
|
owner = "numtide";
|
|
|
|
repo = "flake-utils";
|
2023-02-08 22:05:52 +01:00
|
|
|
ref = "main";
|
2021-04-25 17:50:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
type = "github";
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "home-manager";
|
|
|
|
ref = "master";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
2022-06-22 11:19:43 +02:00
|
|
|
utils.follows = "futils";
|
2021-04-25 17:50:57 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs = {
|
|
|
|
type = "github";
|
|
|
|
owner = "NixOS";
|
|
|
|
repo = "nixpkgs";
|
|
|
|
ref = "nixos-unstable";
|
|
|
|
};
|
|
|
|
|
|
|
|
nur = {
|
|
|
|
type = "github";
|
|
|
|
owner = "nix-community";
|
|
|
|
repo = "NUR";
|
|
|
|
ref = "master";
|
|
|
|
};
|
2021-05-31 23:04:08 +02:00
|
|
|
|
|
|
|
pre-commit-hooks = {
|
|
|
|
type = "github";
|
|
|
|
owner = "cachix";
|
|
|
|
repo = "pre-commit-hooks.nix";
|
|
|
|
ref = "master";
|
|
|
|
inputs = {
|
|
|
|
flake-utils.follows = "futils";
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
2022-11-28 10:17:28 +01:00
|
|
|
nixpkgs-stable.follows = "nixpkgs";
|
2021-05-31 23:04:08 +02:00
|
|
|
};
|
|
|
|
};
|
2021-02-05 16:25:39 +01:00
|
|
|
};
|
|
|
|
|
2021-05-31 23:01:21 +02:00
|
|
|
outputs =
|
|
|
|
inputs @
|
|
|
|
{ self
|
2021-09-25 13:30:51 +02:00
|
|
|
, agenix
|
2021-05-31 23:01:21 +02:00
|
|
|
, futils
|
|
|
|
, home-manager
|
|
|
|
, nixpkgs
|
|
|
|
, nur
|
2021-05-31 23:04:08 +02:00
|
|
|
, pre-commit-hooks
|
2021-05-31 23:01:21 +02:00
|
|
|
}:
|
2021-02-18 21:19:11 +01:00
|
|
|
let
|
2023-03-07 11:44:29 +01:00
|
|
|
inherit (self) lib;
|
|
|
|
|
2022-04-12 10:43:54 +02:00
|
|
|
inherit (futils.lib) eachSystem system;
|
|
|
|
|
|
|
|
mySystems = [
|
2023-03-07 12:42:04 +01:00
|
|
|
system.aarch64-darwin
|
2022-04-12 10:43:54 +02:00
|
|
|
system.aarch64-linux
|
|
|
|
system.x86_64-darwin
|
|
|
|
system.x86_64-linux
|
|
|
|
];
|
|
|
|
|
|
|
|
eachMySystem = eachSystem mySystems;
|
2021-03-07 19:26:20 +01:00
|
|
|
|
2021-02-18 21:19:11 +01:00
|
|
|
in
|
2022-04-12 10:43:54 +02:00
|
|
|
eachMySystem
|
2021-03-07 19:40:54 +01:00
|
|
|
(system:
|
2021-05-31 23:01:21 +02:00
|
|
|
rec {
|
|
|
|
apps = {
|
|
|
|
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
|
2022-05-31 13:41:42 +02:00
|
|
|
default = apps.diff-flake;
|
2021-05-31 23:01:21 +02:00
|
|
|
};
|
|
|
|
|
2023-03-07 11:49:12 +01:00
|
|
|
checks = import ./flake/checks.nix inputs system;
|
2021-05-31 23:04:08 +02:00
|
|
|
|
2023-03-07 11:51:26 +01:00
|
|
|
devShells = import ./flake/dev-shells.nix inputs system;
|
2021-04-20 18:38:20 +02:00
|
|
|
|
2023-03-07 11:53:47 +01:00
|
|
|
packages = import ./flake/packages.nix inputs system;
|
2023-02-25 14:12:53 +01:00
|
|
|
|
|
|
|
# Work-around for https://github.com/nix-community/home-manager/issues/3075
|
|
|
|
legacyPackages = {
|
|
|
|
homeConfigurations = {
|
|
|
|
ambroisie = home-manager.lib.homeManagerConfiguration {
|
|
|
|
# Work-around for home-manager
|
|
|
|
# * not letting me set `lib` as an extraSpecialArgs
|
|
|
|
# * not respecting `nixpkgs.overlays` [1]
|
|
|
|
# [1]: https://github.com/nix-community/home-manager/issues/2954
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
|
|
|
|
overlays = (lib.attrValues self.overlays) ++ [
|
|
|
|
nur.overlay
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
./home
|
|
|
|
{
|
|
|
|
# The basics
|
|
|
|
home.username = "ambroisie";
|
|
|
|
home.homeDirectory = "/home/ambroisie";
|
|
|
|
# Let Home Manager install and manage itself.
|
|
|
|
programs.home-manager.enable = true;
|
|
|
|
# This is a generic linux install
|
|
|
|
targets.genericLinux.enable = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
extraSpecialArgs = {
|
|
|
|
# Inject inputs to use them in global registry
|
|
|
|
inherit inputs;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-05-31 23:01:21 +02:00
|
|
|
}) // {
|
2023-03-07 11:44:29 +01:00
|
|
|
lib = import ./flake/lib.nix inputs;
|
2023-03-07 11:33:49 +01:00
|
|
|
|
2023-03-07 11:36:27 +01:00
|
|
|
overlays = import ./flake/overlays.nix inputs;
|
2021-03-10 19:49:12 +01:00
|
|
|
|
2023-03-07 13:20:14 +01:00
|
|
|
nixosConfigurations = import ./flake/nixos.nix inputs;
|
2021-02-05 16:25:39 +01:00
|
|
|
};
|
|
|
|
}
|