Add configurable stream-tools option
This commit is contained in:
parent
9dab2276d6
commit
d2dceba0e9
41
flake.lock
generated
41
flake.lock
generated
@ -87,11 +87,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"game-of-life": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1728511087,
|
||||
"narHash": "sha256-CvO74jwMjUUPySy0QCt7sPImbxKlhWcSAet93Fkt6iU=",
|
||||
"owner": "local-interloper",
|
||||
"repo": "game-of-life",
|
||||
"rev": "c39d37e394f5da79a6a7d198e1d7e505aa5298a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "local-interloper",
|
||||
"repo": "game-of-life",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726981058,
|
||||
@ -109,6 +127,22 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1717179513,
|
||||
"narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1726320982,
|
||||
"narHash": "sha256-RuVXUwcYwaUeks6h3OLrEmg14z9aFXdWppTWPMTwdQw=",
|
||||
@ -124,7 +158,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1728241625,
|
||||
"narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=",
|
||||
@ -142,8 +176,9 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"game-of-life": "game-of-life",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"snowfall-lib": "snowfall-lib"
|
||||
}
|
||||
},
|
||||
|
||||
18
flake.nix
18
flake.nix
@ -10,13 +10,20 @@
|
||||
url = "github:snowfallorg/lib";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
game-of-life.url = "github:local-interloper/game-of-life";
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
inputs.snowfall-lib.mkFlake {
|
||||
outputs = inputs: let
|
||||
lib = inputs.snowfall-lib.mkLib {
|
||||
inherit inputs;
|
||||
src = ./.;
|
||||
|
||||
channels-config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = _: true;
|
||||
permittedInsecurePackages = ["openssl-1.1.1w"];
|
||||
};
|
||||
|
||||
# Configure Snowfall Lib, all of these settings are optional.
|
||||
snowfall = {
|
||||
# Tell Snowfall Lib to look in the `./nix/` directory for your
|
||||
@ -36,6 +43,13 @@
|
||||
title = "Hion's Personal NixOS Config";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkFlake {
|
||||
inherit inputs;
|
||||
src = ./.;
|
||||
|
||||
|
||||
|
||||
systems.modules.nixos = with inputs; [
|
||||
# my-input.nixosModules.my-module
|
||||
|
||||
32
lib/default.nix
Normal file
32
lib/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{lib, ...}: let
|
||||
inherit (lib) mkOption strings;
|
||||
inherit (lib.attrsets) filterAttrs mapAttrsToList;
|
||||
inherit (lib.types) bool;
|
||||
in rec {
|
||||
disabled = {enable = false;};
|
||||
enabled = {enable = true;};
|
||||
ifThenElse = cond: t: f:
|
||||
if cond
|
||||
then t
|
||||
else f;
|
||||
mkOpt = type: default: description:
|
||||
mkOption {inherit type default description;};
|
||||
mkOpt' = type: default: mkOpt type default null;
|
||||
mkBoolOpt = mkOpt bool;
|
||||
mkBoolOpt' = mkOpt' bool;
|
||||
mkPxeMenu = args:
|
||||
''
|
||||
UI menu.c32
|
||||
TIMEOUT 300
|
||||
''
|
||||
+ strings.concatStringsSep "\n" (mapAttrsToList
|
||||
(
|
||||
name: value: ''
|
||||
LABEL ${name}
|
||||
MENU LABEL ${value.content.label}
|
||||
KERNEL ${value.content.kernel}
|
||||
append ${value.content.append}
|
||||
''
|
||||
)
|
||||
(filterAttrs (_: v: v.condition) args));
|
||||
}
|
||||
21
modules/home/stream-tools.nix
Normal file
21
modules/home/stream-tools.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.my-namespace) mkEnableOption mkIf;
|
||||
cfg = config.my-namespace.home.stream-tools;
|
||||
in {
|
||||
options.my-namespace.home.stream-tools = {
|
||||
enable = mkEnableOption "Enable the Stream Machine Tools";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
obs-studio
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -49,9 +49,12 @@ in
|
||||
soundwireserver
|
||||
vscode
|
||||
spotify
|
||||
appimage-run
|
||||
inputs.game-of-life.packages.x86_64-linux.default
|
||||
# thunderbird
|
||||
];
|
||||
};
|
||||
lib.my-namespace.home.stream-tools.enable = true;
|
||||
|
||||
|
||||
# Open ports in the firewall.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user