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

64 lines
1.6 KiB
Nix

{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
home-manager.url = "github:nix-community/home-manager";
home-manager-flake.url = "git+ssh://gitea@pi1.odie.intranet/odie/home-manager-flake.git";
neovim-flake.url = "git+ssh://gitea@pi1.odie.intranet/odie/neovim-flake.git";
nixos-wsl.url = "github:nix-community/NixOS-WSL";
};
outputs = inputs@{ self, nixpkgs, flake-utils, nixos-wsl, home-manager, ... }:
let
vars = rec {
name = "Patrick Neff";
username = "odie";
homeDirectory = "/home/${username}";
locale = "de_DE.UTF-8";
email = "odie86@gmail.com";
timeZone = "Europe/Berlin";
};
mkSystem = system: hostName: {
${hostName} =
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs;
vars = vars // {
inherit hostName;
};
};
modules = [
./hosts/${hostName}
];
};
};
overlays = [];
mkPkgs = system:
import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
in
{
nixosConfigurations = mkSystem "x86_64-linux" "wsl-dev" // { };
}
// flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = mkPkgs system;
in
{
formatter = pkgs.alejandra;
devShells = {
default = pkgs.mkShell {
name = "nixos";
};
};
});
}