Skip to content

Commit cc5f69e

Browse files
committed
Refactor how things are imported
1 parent 6c7bec6 commit cc5f69e

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

common.nix renamed to default.nix

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
lib,
44
config,
55
pkgs,
6+
hostname,
67
...
78
}: {
9+
imports = [
10+
(import ./${hostname})
11+
];
12+
813
nixpkgs = {
914
config = {
1015
allowUnfree = true;
@@ -33,7 +38,8 @@
3338
options = "--delete-older-than 7d";
3439
};
3540
};
36-
41+
networking.hostName = hostname;
42+
3743
time.timeZone = "America/Detroit";
3844
systemd.coredump.enable = true;
3945

desktop/system.nix renamed to desktop/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
...
77
}: {
88
imports = [
9+
./hardware-configuration.nix
910
inputs.nixos-wsl.nixosModules.default
1011
{
1112
wsl.enable = true;

flake.nix

+3-6
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,15 @@
4848
}:
4949
nixpkgs.lib.nixosSystem {
5050
system = target;
51-
specialArgs = {inherit inputs;};
51+
specialArgs = {inherit inputs; inherit hostname;};
5252
modules =
5353
[
54-
{networking.hostName = hostname;}
55-
./common.nix
56-
./${hostname}/hardware-configuration.nix
57-
./${hostname}/system.nix
54+
./.
5855
home-manager.nixosModules.home-manager
5956
{
6057
home-manager.useGlobalPkgs = true;
6158
home-manager.useUserPackages = true;
62-
home-manager.users.rsmyth = import ./home-manager/home.nix;
59+
home-manager.users.rsmyth = import ./home-manager;
6360
home-manager.extraSpecialArgs = {inherit inputs;};
6461
}
6562
]

home-manager/home.nix renamed to home-manager/default.nix

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
inputs.nix-index-database.hmModules.nix-index
1111
];
1212

13-
nixpkgs = {
14-
overlays = [
15-
];
16-
};
17-
1813
home = {
1914
username = "rsmyth";
2015
homeDirectory = "/home/rsmyth";
@@ -101,7 +96,7 @@
10196
nxswitch = "sudo nixos-rebuild switch --flake ${config.xdg.configHome}/nix";
10297
nxbuild = "sudo nixos-rebuild boot --flake ${config.xdg.configHome}/nix";
10398
nxedit = "${config.home.sessionVariables.EDITOR} ${config.xdg.configHome}/nix";
104-
getLargest = "${lib.getExe pkgs.fd} -t file . --exec ls -s | sort -nr | head-n20";
99+
getLargest = "${lib.getExe pkgs.fd} -t file . --exec ls -s | sort -nr | head -n20";
105100
dev = "nix develop --command ${lib.getExe pkgs.fish}";
106101
scratch = ''systemd-run --property=PrivateTmp=true --description "scratch shell" --user --collect --shell --working-dir "/var/tmp"'';
107102
};

work/system.nix renamed to work/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
...
77
}: {
88
imports = [
9+
./hardware-configuration.nix
910
inputs.nixos-wsl.nixosModules.default
1011
{
1112
wsl.enable = true;

0 commit comments

Comments
 (0)