Skip to content

Commit

Permalink
treewide: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Sep 29, 2023
1 parent 52c7496 commit 0f73cdb
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 52 deletions.
16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,21 @@
(mkNixOSConfig { hostname = "zachune-nixos"; })

# Home-Manager configs
(mkHomeConfig { hostname = "home-linux"; })
(mkHomeConfig {
hostname = "home-linux-minimal";
configuration = ./home-manager/minimal.nix;
hostname = "home-linux";
extraModules = [{
home-manager = {
desktop.enable = true;
dev = {
clojure.enable = true;
go.enable = true;
node.enable = true;
python.enable = true;
};
};
}];
})
(mkHomeConfig { hostname = "home-linux-minimal"; })
(mkHomeConfig {
hostname = "steamdeck";
username = "deck";
Expand Down
7 changes: 3 additions & 4 deletions home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

{
imports = [
./cli
./desktop
./dev
./minimal.nix
./editor
./meta
./theme
];

# More reliable user service restart
systemd.user.startServices = "sd-switch";
}
2 changes: 1 addition & 1 deletion home-manager/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
./xterm.nix
];

options.home-manager.desktop.enable = lib.mkDefaultOption "desktop config";
options.home-manager.desktop.enable = lib.mkEnableOption "desktop config";

config = lib.mkIf config.home-manager.desktop.enable {
home.packages = with pkgs; [
Expand Down
2 changes: 1 addition & 1 deletion home-manager/editor/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
in
{
options.home-manager.editor.emacs.enable = lib.mkEnableOption "Emacs config" // {
default = (config.home-manager.editor.enable && (config.home-manager.desktop.enable or false));
default = config.home-manager.editor.enable && config.home-manager.desktop.enable;
};

config = lib.mkIf config.home-manager.editor.emacs.enable {
Expand Down
2 changes: 1 addition & 1 deletion home-manager/editor/vscode/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
options.home-manager.editor.vscode.enable = lib.mkEnableOption "VScode config" // {
default = (config.home-manager.editor.enable && (config.home-manager.desktop.enable or false));
default = config.home-manager.editor.enable && config.home-manager.desktop.enable;
};

config = lib.mkIf config.home-manager.editor.vscode.enable {
Expand Down
2 changes: 1 addition & 1 deletion home-manager/macos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
imports = [
./minimal.nix
./default.nix
];

home-manager.editor.emacs.enable = true;
Expand Down
3 changes: 3 additions & 0 deletions home-manager/meta/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
# changes in each release.
home.stateVersion = (osConfig.system.stateVersion or "23.11");

# More reliable user service restart
systemd.user.startServices = lib.mkIf pkgs.stdenv.isLinux "sd-switch";

manual.html.enable = true;
}
11 changes: 0 additions & 11 deletions home-manager/minimal.nix

This file was deleted.

15 changes: 9 additions & 6 deletions home-manager/nixos.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{ ... }:
{ osConfig, ... }:

{
imports = [
./default.nix
];

home-manager.dev = {
clojure.enable = true;
go.enable = true;
node.enable = true;
python.enable = true;
home-manager = {
desktop.enable = (osConfig.nixos.desktop.enable or false);
dev = {
clojure.enable = true;
go.enable = true;
node.enable = true;
python.enable = true;
};
};
}
2 changes: 1 addition & 1 deletion home-manager/steamdeck.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
imports = [
./minimal.nix
./default.nix
];

home-manager.editor.emacs.enable = true;
Expand Down
4 changes: 0 additions & 4 deletions hosts/mirai-vps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
../../nixos
];

nixos.home.imports = [
../../home-manager/minimal.nix
];

device.type = "server";

nixos = {
Expand Down
4 changes: 0 additions & 4 deletions hosts/zachune-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"${modulesPath}/virtualisation/oci-common.nix"
];

nixos.home.imports = [
../../home-manager/minimal.nix
];

device.type = "server";

nixos = {
Expand Down
4 changes: 0 additions & 4 deletions hosts/zatsune-nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
flake.inputs.disko.nixosModules.disko
];

nixos.home.imports = [
../../home-manager/minimal.nix
];

boot.kernelParams = [
"nvme.shutdown_timeout=10"
"nvme_core.shutdown_timeout=10"
Expand Down
3 changes: 2 additions & 1 deletion lib/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ in
, configPosfix ? "Projects/nix-configs"
, configuration ? ../home-manager
, deviceType ? "desktop"
, extraModules ? [ ]
, system ? "x86_64-linux"
, homeManagerConfiguration ? home.lib.homeManagerConfiguration
}:
Expand All @@ -104,7 +105,7 @@ in
home = { inherit username homeDirectory; };
imports = [ configuration ];
})
];
] ++ extraModules;
lib = nixpkgs.lib.extend (final: prev:
(import ../lib { lib = final; })
);
Expand Down
4 changes: 3 additions & 1 deletion nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

{
imports = [
../modules
./desktop
./dev
./games
./home.nix
./laptop
./minimal.nix
./nix
./server
./system
];
}
9 changes: 0 additions & 9 deletions nixos/minimal.nix

This file was deleted.

0 comments on commit 0f73cdb

Please sign in to comment.