This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-config/flake.nix

91 lines
3.0 KiB
Nix
Raw Normal View History

2022-06-10 05:22:53 +02:00
{
description = "My system config";
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.05";
2022-07-16 07:12:18 +02:00
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
2022-06-10 05:22:53 +02:00
home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
2022-07-21 05:32:09 +02:00
nur.url = "github:nix-community/NUR";
2022-08-05 16:20:13 +02:00
2022-08-07 01:16:17 +02:00
alacritty-sixel.url = "github:microo8/alacritty-sixel";
alacritty-sixel.flake = false;
2022-08-07 01:36:14 +02:00
ranger-sixel.url = "github:remi6397/ranger/feature/sixel";
ranger-sixel.flake = false;
2022-08-02 01:15:26 +02:00
# my stuff
dhist.url = "github:lelgenio/dhist";
2022-06-10 05:22:53 +02:00
};
2022-08-07 20:12:25 +02:00
outputs = { nixpkgs, nixpkgs-unstable, home-manager, alacritty-sixel
, ranger-sixel, nur, dhist, ... }:
2022-06-10 05:22:53 +02:00
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
2022-07-16 07:12:18 +02:00
overlay-unstable = final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
# use this variant if unfree packages are needed:
# unstable = import nixpkgs-unstable {
# inherit system;
# config.allowUnfree = true;
# };
};
2022-06-10 05:22:53 +02:00
lib = nixpkgs.lib;
2022-07-16 07:12:18 +02:00
common_modules = [
./system/configuration.nix
# nur.nixosModules.nur
2022-08-06 23:32:34 +02:00
({ config, pkgs, ... }: {
2022-08-05 16:20:13 +02:00
nixpkgs.overlays = [
2022-08-06 23:32:34 +02:00
overlay-unstable
nur.overlay
2022-08-07 01:16:17 +02:00
(_: old-pkgs: {
2022-08-08 03:44:21 +02:00
uservars = import ./user/variables.nix;
2022-08-02 01:15:26 +02:00
dhist = dhist.packages.${system}.dhist;
2022-08-07 20:12:25 +02:00
alacritty = (old-pkgs.alacritty.overrideAttrs
(old-alacritty: rec {
src = alacritty-sixel;
cargoDeps = old-alacritty.cargoDeps.overrideAttrs
(old-pkgs.lib.const {
inherit src;
outputHash =
"sha256-aNatd4LC4lv0bDpVfUONdtEn9OPahVBZ9ch14pWWCnM=";
});
}));
2022-08-07 01:36:14 +02:00
ranger = (old-pkgs.ranger.overridePythonAttrs (old-ranger: rec {
src = ranger-sixel;
2022-08-07 20:12:25 +02:00
checkInputs = [ ];
2022-08-08 03:44:21 +02:00
propagatedBuildInputs = with old-pkgs.python3Packages;
2022-08-07 20:12:25 +02:00
old-ranger.propagatedBuildInputs ++ [ astroid pylint pytest ];
2022-08-07 01:36:14 +02:00
}));
2022-08-02 01:15:26 +02:00
})
2022-08-08 03:44:21 +02:00
(import ./scripts { inherit config pkgs lib; })
2022-08-02 01:15:26 +02:00
];
2022-07-21 05:32:09 +02:00
})
2022-07-16 07:12:18 +02:00
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.lelgenio = import ./user/home.nix;
home-manager.backupFileExtension = "bkp";
2022-07-16 07:12:18 +02:00
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
2022-06-10 05:22:53 +02:00
in {
nixosConfigurations = {
i15 = lib.nixosSystem {
inherit system;
2022-08-08 03:45:52 +02:00
modules = [ ./hosts/i15.nix ]
2022-07-21 05:32:09 +02:00
++ common_modules;
2022-07-16 07:12:18 +02:00
};
2022-07-12 02:34:04 +02:00
monolith = lib.nixosSystem {
inherit system;
2022-08-08 03:45:52 +02:00
modules = [ ./hosts/monolith.nix ]
2022-07-21 05:32:09 +02:00
++ common_modules;
2022-06-10 05:22:53 +02:00
};
};
};
2022-07-21 05:32:09 +02:00
}