mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
extract unfree option to it's own module
This commit is contained in:
parent
03b359ee5a
commit
3aef3e349f
2 changed files with 74 additions and 73 deletions
|
|
@ -5,82 +5,71 @@
|
||||||
nix-janitor,
|
nix-janitor,
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.local.allowedUnfree = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
nixpkgs.config.allowAliases = false;
|
||||||
|
local.packages = {
|
||||||
nixpkgs.config = {
|
inherit (pkgs)
|
||||||
allowAliases = false;
|
bottom # view tasks
|
||||||
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
|
efibootmgr # efi editor
|
||||||
};
|
nix-output-monitor # nom nom nom nom;
|
||||||
|
nix-tree # view packages
|
||||||
local.packages = {
|
pciutils # lspci
|
||||||
inherit (pkgs)
|
;
|
||||||
bottom # view tasks
|
nix-janitor = pkgs.symlinkJoin {
|
||||||
efibootmgr # efi editor
|
name = "nix-janitor";
|
||||||
nix-output-monitor # nom nom nom nom;
|
paths = [ nix-janitor.packages.default ];
|
||||||
nix-tree # view packages
|
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
|
||||||
pciutils # lspci
|
postBuild = ''
|
||||||
;
|
wrapProgram "$out/bin/janitor" \
|
||||||
nix-janitor = pkgs.symlinkJoin {
|
--suffix PATH : ${lib.makeBinPath [ config.nix.package ]}
|
||||||
name = "nix-janitor";
|
|
||||||
paths = [ nix-janitor.packages.default ];
|
|
||||||
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
|
|
||||||
postBuild = ''
|
|
||||||
wrapProgram "$out/bin/janitor" \
|
|
||||||
--suffix PATH : ${lib.makeBinPath [ config.nix.package ]}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git.enable = true;
|
|
||||||
# Mr sandro why
|
|
||||||
services.libinput.enable = true;
|
|
||||||
programs.nano.enable = false;
|
|
||||||
|
|
||||||
environment.defaultPackages = lib.mkForce [ ];
|
|
||||||
|
|
||||||
#enable ssh
|
|
||||||
programs.mtr.enable = true; # ping and traceroute
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
hostKeys = lib.mkForce [
|
|
||||||
{
|
|
||||||
path = "/etc/ssh/ssh_host_ed25519_key";
|
|
||||||
type = "ed25519";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
settings = {
|
|
||||||
PermitRootLogin = lib.mkDefault "no";
|
|
||||||
PasswordAuthentication = false;
|
|
||||||
KbdInteractiveAuthentication = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.ssh = {
|
|
||||||
startAgent = true;
|
|
||||||
agentTimeout = "1m";
|
|
||||||
extraConfig = ''
|
|
||||||
AddKeysToAgent yes
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
#time settings
|
|
||||||
|
|
||||||
time.timeZone = "America/New_York";
|
|
||||||
|
|
||||||
# For `info` command.
|
|
||||||
documentation.info.enable = false;
|
|
||||||
# NixOS manual and such.
|
|
||||||
documentation.nixos.enable = false;
|
|
||||||
# Useless with flakes (without configuring)
|
|
||||||
programs.command-not-found.enable = false;
|
|
||||||
|
|
||||||
system.rebuild.enableNg = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.git.enable = true;
|
||||||
|
# Mr sandro why
|
||||||
|
services.libinput.enable = true;
|
||||||
|
programs.nano.enable = false;
|
||||||
|
|
||||||
|
environment.defaultPackages = lib.mkForce [ ];
|
||||||
|
|
||||||
|
#enable ssh
|
||||||
|
programs.mtr.enable = true; # ping and traceroute
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
hostKeys = lib.mkForce [
|
||||||
|
{
|
||||||
|
path = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
|
type = "ed25519";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = lib.mkDefault "no";
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
KbdInteractiveAuthentication = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.ssh = {
|
||||||
|
startAgent = true;
|
||||||
|
agentTimeout = "1m";
|
||||||
|
extraConfig = ''
|
||||||
|
AddKeysToAgent yes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
#time settings
|
||||||
|
|
||||||
|
time.timeZone = "America/New_York";
|
||||||
|
|
||||||
|
# For `info` command.
|
||||||
|
documentation.info.enable = false;
|
||||||
|
# NixOS manual and such.
|
||||||
|
documentation.nixos.enable = false;
|
||||||
|
# Useless with flakes (without configuring)
|
||||||
|
programs.command-not-found.enable = false;
|
||||||
|
|
||||||
|
system.rebuild.enableNg = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
nixosModules/unfree.nix
Normal file
12
nixosModules/unfree.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{ lib, config }:
|
||||||
|
{
|
||||||
|
options.local.allowedUnfree = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
nixpkgs.config.allowUnfreePredicate =
|
||||||
|
pkg: builtins.elem (lib.getName pkg) config.local.allowedUnfree;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue