2024-01-06 11:11:19 +00:00
|
|
|
# A very basic NixOS VM configuration intended for testing out the given
|
|
|
|
# workflow module. It's a good thing the baseline for the configuration is not
|
2024-02-15 15:14:33 +00:00
|
|
|
# tedious to set up for simpler configs like this. Just take note this is
|
|
|
|
# executed on a separate directory as its own so relative paths are moot.
|
2024-03-03 08:40:31 +00:00
|
|
|
{ workflow }:
|
2024-01-05 12:20:37 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pkgs = import <nixpkgs> { };
|
2024-02-11 07:16:25 +00:00
|
|
|
lib = pkgs.lib;
|
2024-01-05 12:20:37 +00:00
|
|
|
in
|
|
|
|
import <nixpkgs/nixos/lib/eval-config.nix> {
|
|
|
|
inherit lib;
|
2024-03-03 02:26:50 +00:00
|
|
|
specialArgs = {
|
|
|
|
foodogsquaredUtils = import <config/lib/utils/nixos.nix> { inherit lib; };
|
2024-03-15 09:31:16 +00:00
|
|
|
foodogsquaredModulesPath = builtins.toString <config/modules/nixos>;
|
2024-03-03 02:26:50 +00:00
|
|
|
};
|
2024-03-03 08:40:31 +00:00
|
|
|
modules = [
|
|
|
|
# You can include an extra set by setting `extra-config` as part of the
|
|
|
|
# include path. It is expected that this will not be overridden by the
|
|
|
|
# script or the build process.
|
|
|
|
<extra-config/modules/nixos>
|
|
|
|
|
2024-01-20 09:16:02 +00:00
|
|
|
<config/modules/nixos>
|
|
|
|
<config/modules/nixos/_private>
|
2024-01-27 08:52:00 +00:00
|
|
|
<config/modules/nixos/profiles/generic.nix>
|
|
|
|
<config/modules/nixos/profiles/nix-conf.nix>
|
2024-03-10 23:51:07 +00:00
|
|
|
<config/modules/nixos/profiles/overlays.nix>
|
2024-03-03 08:40:31 +00:00
|
|
|
<config/modules/nixos/profiles/desktop>
|
2024-01-05 12:20:37 +00:00
|
|
|
<home-manager/nixos>
|
|
|
|
<nixos-generators/formats/vm.nix>
|
|
|
|
<nixos-generators/format-module.nix>
|
2024-03-03 02:26:50 +00:00
|
|
|
({ config, lib, pkgs, foodogsquaredUtils, ... }: {
|
2024-01-05 12:20:37 +00:00
|
|
|
imports = [
|
2024-03-03 02:26:50 +00:00
|
|
|
(foodogsquaredUtils.mapHomeManagerUser "alice" {
|
2024-03-15 09:31:16 +00:00
|
|
|
initialHashedPassword = "";
|
|
|
|
extraGroups = [ "wheel" "networkmanager" "video" ];
|
2024-01-12 11:27:04 +00:00
|
|
|
description = "There is no password";
|
|
|
|
isNormalUser = true;
|
|
|
|
createHome = true;
|
|
|
|
home = "/home/alice";
|
|
|
|
})
|
2024-01-05 12:20:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
2024-02-15 15:14:33 +00:00
|
|
|
# Enable the display manager of choice.
|
|
|
|
services.xserver.displayManager.gdm.enable = true;
|
|
|
|
|
|
|
|
# Configure home-manager-related stuff.
|
2024-01-27 08:52:00 +00:00
|
|
|
home-manager.useUserPackages = lib.mkDefault true;
|
|
|
|
home-manager.useGlobalPkgs = lib.mkDefault true;
|
2024-03-03 08:40:31 +00:00
|
|
|
home-manager.sharedModules = [
|
|
|
|
# Same with home-manager modules.
|
|
|
|
<extra-config/modules/nixos>
|
|
|
|
|
2024-01-20 09:16:02 +00:00
|
|
|
<config/modules/home-manager>
|
|
|
|
<config/modules/home-manager/_private>
|
2024-01-06 11:11:19 +00:00
|
|
|
<sops-nix/modules/home-manager/sops.nix>
|
|
|
|
({ config, lib, ... }: {
|
2024-01-12 11:27:04 +00:00
|
|
|
xdg.userDirs.createDirectories = lib.mkForce true;
|
2024-01-06 11:11:19 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-02-15 15:14:33 +00:00
|
|
|
# The main function of the configuration.
|
2024-01-05 12:20:37 +00:00
|
|
|
workflows.workflows.${workflow}.enable = true;
|
|
|
|
|
|
|
|
system.stateVersion = "23.11";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|