More flakes stuff

This commit is contained in:
Riley Apeldoorn 2022-05-15 17:31:45 +02:00
parent d427da7804
commit 7c75d415ff
6 changed files with 58 additions and 24 deletions

16
common.nix Normal file
View file

@ -0,0 +1,16 @@
# Holds common settings for all systems.
{ ... }: {
nix = {
optimise.automatic = true;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
nixpkgs.config.allowUnfree = true;
boot.cleanTmpDir = true;
}

View file

@ -34,16 +34,17 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1652623270, "lastModified": 1611574965,
"narHash": "sha256-DZXGCio58hPeBHVk9o0khafZav23jpOIm4QpbJZThpw=", "narHash": "sha256-IYtGS077nJFIqSq6Cb8WEJwbqqd4K7S4vUuwPZKfLeo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs-channels",
"rev": "d595d207baa598ca62a2da003a96510529fec9e4", "rev": "4762fba469e2baa82f983b262e2c06ac2fdaae67",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "ref": "nixos-unstable",
"repo": "nixpkgs-channels",
"type": "github" "type": "github"
} }
}, },

View file

@ -1,14 +1,35 @@
{ {
inputs = { inputs = {
nixpkgs.url = github:NixOS/nixpkgs;
home-manager.url = github:nix-community/home-manager; nixpkgs = {
url = github:NixOS/nixpkgs-channels/nixos-unstable;
};
home-manager = {
url = github:nix-community/home-manager;
};
}; };
outputs = { self, nixpkgs, home-manager }: with nixpkgs; { outputs = args: with args.nixpkgs; {
nixosConfigurations."thor" = lib.nixosSystem { nixosConfigurations = {
system = "x86_64-linux"; "thor" = lib.nixosSystem {
modules = [ ./configuration.nix ]; system = "x86_64-linux";
modules = [
./machines/thor/configuration.nix
./common.nix
];
specialArgs = args;
};
"loki" = lib.nixosSystem {
system = "x86_64-linux";
modules = [
./machines/loki/configuration.nix
./common.nix
];
specialArgs = args;
};
}; };
}; };

View file

@ -11,6 +11,8 @@
kak.ide = true; kak.ide = true;
}; };
system.stateVersion = "21.11";
networking = { networking = {
hostName = "thor"; hostName = "thor";
interfaces.enp9s0.useDHCP = true; interfaces.enp9s0.useDHCP = true;

View file

@ -1,6 +1,6 @@
# Global config # Modules used by most systems.
{ config, lib, pkgs, ... }: { config, lib, pkgs, home-manager, ... }:
with lib; with types; with lib; with types;
let named = submodule { let named = submodule {
@ -104,7 +104,7 @@ let named = submodule {
imports = [ imports = [
<home-manager/nixos> home-manager.nixosModule
./kak ./kak
./gui ./gui
@ -189,8 +189,6 @@ let named = submodule {
loader.efi = { loader.efi = {
canTouchEfiVariables = true; canTouchEfiVariables = true;
}; };
cleanTmpDir = true;
}; };
networking = { networking = {
@ -198,7 +196,6 @@ let named = submodule {
useDHCP = false; useDHCP = false;
}; };
nixpkgs.config.allowUnfree = true;
security.rtkit.enable = true; security.rtkit.enable = true;
users.users."riley" = { users.users."riley" = {
@ -206,12 +203,5 @@ let named = submodule {
extraGroups = [ "wheel" ]; # Enable sudo for the user. extraGroups = [ "wheel" ]; # Enable sudo for the user.
}; };
nix = {
optimise.automatic = true;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
}; };
} }

4
scripts/README.md Normal file
View file

@ -0,0 +1,4 @@
# Scripts
This directory contains nix derivations for shell scripts I want to use across
devices.