Skip to content

Commit

Permalink
imp: add a nixos module
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jul 1, 2021
1 parent e963e74 commit 6a645a2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

in
{
nixosModules.flk = import ./nixosModule.nix;

defaultPackage = ufrContract supportedSystems ./. flkInputs;

Expand Down
28 changes: 28 additions & 0 deletions nixosModule.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# the flk function that still needs to be instantiated
flk:

{ config, pkgs, lib, ... }:
let
cfg = config.flk;
in
with lib; {
options.flk = {
enable = mkEnableOption "enable flk sysctl tool";
localFlakeClone = mkOption {
type = types.string;
description = ''
A string reference to the local (editable) copy
of your system flake. This is used as reference
so that the scripts can do work on your flake,
such as for example updating inputs.
'';
};
};

config = mkIf cfg.enable {
environment.systemPackages = [
(flk { inherit pkgs; hostConfig = config; editableFlakeRoot = cfg.localFlakeClone; })
];
};

}

0 comments on commit 6a645a2

Please sign in to comment.