Files
vmimages/flake.nix
2023-11-30 14:53:33 +00:00

90 lines
2.8 KiB
Nix

{
description = "Your new nix config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/release-23.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
#nixos-hardware.url = "github:NixOS/nixos-hardware"; # Import nixos hardware quirks settings
nixos-wsl = {
url = "github:nix-community/nixos-wsl";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix.url = github:Mic92/sops-nix;
vscode-server.url = "github:msteen/nixos-vscode-server";
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ... }@inputs:
let
mkHost = hostName: system:
nixpkgs.lib.nixosSystem {
pkgs = import nixpkgs {
inherit system;
# settings to nixpkgs goes to here
# nixpkgs.pkgs.zathura.useMupdf = true;
nixpkgs.config.allowUnfree = true;
};
specialArgs = {
# inherit inputs outputs lib;
# By default, the system will only use packages from the
# stable channel. You can selectively install packages
# from the unstable channel. You can also add more
# channels to pin package version.
pkgs-unstable = import nixpkgs-unstable {
inherit system;
# settings to nixpkgs-unstable goes to here
};
# make all inputs availabe in other nix files
inherit inputs outputs lib;
};
modules = [
#./modules
./hosts/${hostName}
# home-manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.sstent = import ./home-manager;
home-manager.sharedModules = [
inputs.sops-nix.homeManagerModules.sops
];
}
];
};
in {
# Output all modules in ./modules to flake. Modules should be in
# individual subdirectories and contain a default.nix file
nixosModules = builtins.listToAttrs (map
(x: {
name = x;
value = import (./modules/nixos + "/${x}");
})
(builtins.attrNames (builtins.readDir ./modules/nixos)));
# Output all modules in ./modules to flake. Modules should be in
# individual subdirectories and contain a default.nix file
homeManagerModules = builtins.listToAttrs (map
(name: {
inherit name;
value = import (./modules/home-manager + "/${name}");
})
(builtins.attrNames (builtins.readDir ./modules/home-manager)));
nixosConfigurations = {
StuPC-WSL = mkHost "StuPC-WSL" "x86_64-linux";
};
};
}