devos/nix: add nix module

This commit is contained in:
Infinidoge 2021-12-03 15:18:19 -05:00
parent c9835984c0
commit 2dd4d9860f
3 changed files with 18 additions and 19 deletions

View file

@ -1,5 +1,8 @@
{ config, lib, ... }: {
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = {
main = config;
};

View file

@ -1,7 +0,0 @@
{ channel, inputs, ... }: {
nix.nixPath = [
"nixpkgs=${channel.input}"
"nixos-config=${../../lib/compat/nixos}"
"home-manager=${inputs.home}"
];
}

View file

@ -1,5 +1,6 @@
{ config, pkgs, self, lib, ... }: {
{ channel, inputs, pkgs, lib, ... }:
with lib;
{
nix = {
package = pkgs.nixUnstable;
@ -23,13 +24,24 @@
keep-derivations = true
fallback = true
'';
nixPath = [
"nixpkgs=${channel.input}"
"nixos-config=${../../lib/compat/nixos}"
"home-manager=${inputs.home}"
];
};
nixpkgs.config = {
allowUnfree = true;
};
environment = {
systemPackages = with pkgs; [ nix-index nixfmt nixpkgs-fmt ];
shellAliases =
let ifSudo = lib.mkIf config.security.sudo.enable;
let ifSudo = mkIf config.security.sudo.enable;
in
{
# nix
@ -50,13 +62,4 @@
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
};
};
nixpkgs.config = {
allowUnfree = true;
};
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
};
}