Remove extraneous arguments; fix anytype hash; fix imports; make home build
diff --git a/flake.lock b/flake.lock
index b9263a8..31ad303 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,7 +2,9 @@
"nodes": {
"home-manager": {
"inputs": {
- "nixpkgs": "nixpkgs"
+ "nixpkgs": [
+ "nixpkgs"
+ ]
},
"locked": {
"lastModified": 1643933536,
@@ -21,20 +23,6 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1646331602,
- "narHash": "sha256-cRuytTfel52z947yKfJcZU7zbQBgM16qqTf+oJkVwtg=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "ad267cc9cf3d5a6ae63940df31eb31382d6356e6",
- "type": "github"
- },
- "original": {
- "id": "nixpkgs",
- "type": "indirect"
- }
- },
- "nixpkgs_2": {
- "locked": {
"lastModified": 1646258393,
"narHash": "sha256-mKDoCi5Baqainjf0Nx6oTPhaxKQdj4P17XTdhTtXGRA=",
"owner": "nixos",
@@ -52,7 +40,7 @@
"root": {
"inputs": {
"home-manager": "home-manager",
- "nixpkgs": "nixpkgs_2"
+ "nixpkgs": "nixpkgs"
}
}
},
diff --git a/flake.nix b/flake.nix
index 85b5da2..d39c8c7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,6 +4,9 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
home-manager.url = "github:nix-community/home-manager/release-21.11";
+
+ # Make sure flakes we depend on use the same version of nixpkgs as we do
+ home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager }:
@@ -34,11 +37,17 @@
username = variables.username;
homeDirectory = "/home/${username}";
+ stateVersion = variables.stateVersion;
configuration = {
imports = [
src/home.nix
];
+
+ programs.home-manager.enable = true;
+ # Although I don't do any other configuration here directly,
+ # this is needed to make home-manager work and so *must* be
+ # present on every home manager configuration.
};
};
};
diff --git a/src/apps/personal/comma.nix b/src/apps/personal/comma.nix
index 7a8fa47..477c4e6 100644
--- a/src/apps/personal/comma.nix
+++ b/src/apps/personal/comma.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs, ... }:
+{ pkgs, ... }:
let
comma = import ( pkgs.fetchFromGitHub {
owner = "nix-community";
diff --git a/src/apps/personal/git.nix b/src/apps/personal/git.nix
index 37a52ea..fbac0df 100644
--- a/src/apps/personal/git.nix
+++ b/src/apps/personal/git.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs }: {
+{ ... }: {
programs.git = {
enable = true;
diff --git a/src/apps/personal/go.nix b/src/apps/personal/go.nix
index dcf5a90..629d1cf 100644
--- a/src/apps/personal/go.nix
+++ b/src/apps/personal/go.nix
@@ -1,3 +1,3 @@
-{ config, pkgs, nixpkgs }: {
+{ ... }: {
programs.go.enable = true;
}
\ No newline at end of file
diff --git a/src/apps/personal/gpg.nix b/src/apps/personal/gpg.nix
index 71b5dba..a064ed0 100644
--- a/src/apps/personal/gpg.nix
+++ b/src/apps/personal/gpg.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs }: {
+{ pkgs, ... }: {
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
diff --git a/src/apps/personal/nodejs.nix b/src/apps/personal/nodejs.nix
index b8ed6ac..cfb562b 100644
--- a/src/apps/personal/nodejs.nix
+++ b/src/apps/personal/nodejs.nix
@@ -1,7 +1,5 @@
-{ config, pkgs, nixpkgs }: {
+{ pkgs, ... }: {
home.packages = with pkgs; [
nodejs-17_x
];
-
- programs.steam.enable = true;
}
\ No newline at end of file
diff --git a/src/apps/personal/overlay/anytype.nix b/src/apps/personal/overlays/anytype.nix
similarity index 94%
rename from src/apps/personal/overlay/anytype.nix
rename to src/apps/personal/overlays/anytype.nix
index e40117d..7106f27 100644
--- a/src/apps/personal/overlay/anytype.nix
+++ b/src/apps/personal/overlays/anytype.nix
@@ -1,6 +1,6 @@
final: prev: let
build = "57693545";
- sha = "sha256-ayexUZNn7QGHjXYO/+1kUebTmAzdVpwG9Ile8Uh3i8Q=";
+ sha = "sha256-QyexUZNn7QGHjXYO/+1kUebTmAzdVpwG9Ile8Uh3i8Q=";
pname = "anytype";
name = "${pname}-${build}";
diff --git a/src/apps/personal/overlays/nur.nix b/src/apps/personal/overlays/nur.nix
new file mode 100644
index 0000000..9373b18
--- /dev/null
+++ b/src/apps/personal/overlays/nur.nix
@@ -0,0 +1,8 @@
+final: prev: let
+ nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz");
+in {
+ nur = nur {
+ nurpkgs = prev;
+ pkgs = prev;
+ };
+}
\ No newline at end of file
diff --git a/src/apps/personal/spotify.nix b/src/apps/personal/spotify.nix
index c341bf4..e79f372 100644
--- a/src/apps/personal/spotify.nix
+++ b/src/apps/personal/spotify.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs }: {
+{ pkgs, ... }: {
home.packages = with pkgs; [
spotify
];
diff --git a/src/apps/personal/steam.nix b/src/apps/personal/steam.nix
index 095bc0f..181add1 100644
--- a/src/apps/personal/steam.nix
+++ b/src/apps/personal/steam.nix
@@ -1,7 +1,11 @@
-{ config, pkgs, nixpkgs }: {
+{ pkgs, ... }: {
home.packages = with pkgs; [
steam-run
];
- programs.steam.enable = true;
+ # Due to opening the firewall and creating udev rules,
+ # steam proper can only be installed in the main system configuration.
+
+ # Steam-run is a FHS-compliant wrapper (around any executable), which
+ # we can run here, but the main steam package is not here
}
\ No newline at end of file
diff --git a/src/apps/personal/vscode.nix b/src/apps/personal/vscode.nix
index e1b2c2e..925c633 100644
--- a/src/apps/personal/vscode.nix
+++ b/src/apps/personal/vscode.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs }: {
+{ pkgs, ... }: {
programs.vscode.enable = true;
programs.vscode.package = pkgs.vscode-fhs;
}
\ No newline at end of file
diff --git a/src/apps/personal/zsh.nix b/src/apps/personal/zsh.nix
index 1f1f129..650948a 100644
--- a/src/apps/personal/zsh.nix
+++ b/src/apps/personal/zsh.nix
@@ -1,4 +1,4 @@
-{ config, pkgs, nixpkgs }: {
+{ config, ... }: {
programs.zsh = {
enable = true;
oh-my-zsh = {
diff --git a/src/home.nix b/src/home.nix
index e266584..8a11c25 100644
--- a/src/home.nix
+++ b/src/home.nix
@@ -1,18 +1,12 @@
-{ config, pkgs, nixpkgs }:
+{ pkgs, lib, ... }:
let
variables = import ./common/variables.nix;
- personalPackages = let
- toPkg = file: {
- name = builtins.replaceStrings [ ".nix" ] [ "" ] file;
- value = "./apps/personal/${file}";
- };
- in pkgs.lib.mapAttrs' toPkg (builtins.readDir (./. + "/apps/personal/"));
+ personalPackages = import ./utils/nixFilesIn.nix lib ./apps/personal;
+ overlays = import ./utils/nixFilesIn.nix lib ./apps/personal/overlays;
in {
- import = personalPackages;
+ imports = personalPackages;
- nixpkgs.overlays = [
- (import ./overlays/anytype.nix)
- ];
+ nixpkgs.overlays = map (f: import f) overlays;
home.packages = with pkgs; [ # New apps should be on new lines
anytype
@@ -28,15 +22,11 @@
file
nur.repos.kira-bruneau.rofi-wayland
rofimoji
- anytype-latest
htop
hue-cli
zip
- mindustry-alpha-wayland
element
tdesktop
]; # Use *only* for packages that need no configuration;
# other packages should go in ./apps/personal/
-
- home.stateVersion = variables.stateVersion;
}
\ No newline at end of file
diff --git a/src/utils/nixFilesIn.nix b/src/utils/nixFilesIn.nix
new file mode 100644
index 0000000..b5340bd
--- /dev/null
+++ b/src/utils/nixFilesIn.nix
@@ -0,0 +1,2 @@
+# Modified from http://chriswarbo.net/projects/nixos/useful_hacks.html
+lib: dir: map (name: dir + "/${name}") (lib.attrNames (lib.filterAttrs (name: _: lib.hasSuffix ".nix" name) (builtins.readDir dir)))