Skip to content

Commit

Permalink
fix,refactor: see details
Browse files Browse the repository at this point in the history
- fix unused home manager configuration
- place foreign packages in flake output
- cleanup swaylock osConfig shenenigans
- force overwrite mimeapps.list on HM switches
  • Loading branch information
mrnossiom committed Jan 4, 2024
1 parent de76c23 commit c1a05b7
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 45 deletions.
224 changes: 223 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 24 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,34 @@
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.

home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";

agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.home-manager.follows = "home-manager";

nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";

disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";

nix-colors.url = "github:misterio77/nix-colors";

nixos-hardware.url = "github:nixos/nixos-hardware";

git-leave.url = "github:mrnossiom/git-leave";
git-leave.inputs.nixpkgs.follows = "nixpkgs";

radicle.url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5";
radicle.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, home-manager, nixos-hardware, ... }:
outputs = { self, nixpkgs, nixos-hardware, ... }:
let
inherit (self) inputs outputs;
inherit (nixpkgs.lib) nixosSystem genAttrs;
inherit (home-manager) homeManagerConfiguration;

forAllSystems = genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
flake-lib = import ./lib/flake (nixpkgs // { inherit self; });
Expand All @@ -45,7 +42,7 @@
inherit system;
config.allowUnfreePredicate = import ./lib/unfree.nix;
overlays = [ outputs.overlays.all ];
}) // { inherit self; });
}));
in
{
formatter = forAllSystems (system: pkgs.${system}.nixpkgs-fmt);
Expand Down Expand Up @@ -76,14 +73,14 @@
];
};

# In non-NixOS contexts, you can still home manager to manage dotfiles.
# Else, configuration is loaded by the HM NixOS module which create system generations and free rollbacks.
# I bundle my Home Manager config via the NixOS modules which create system generations and give free rollbacks.
# However, in non-NixOS contexts, you can still use Home Manager to manage dotfiles using this template.
homeConfigurations = {
milomoisson = homeManagerConfiguration {
pkgs = nixpkgs.pkgs;
extraSpecialArgs = { inherit self; };
modules = [ ./home-manager/profiles/desktop.nix ];
};
# "<username>@<hostname>" = homeManagerConfiguration {
# pkgs = pkgs."<system>";
# extraSpecialArgs = { inherit self; osConfig = null; };
# modules = [ ./home-manager/profiles/desktop.nix ];
# };
};
};
}
12 changes: 4 additions & 8 deletions home-manager/modules/vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ in
ignore-empty-password = true;
show-failed-attempts = true;

indicator-y-position =
if cfg != null
then ((cfg.height * 0.9) / cfg.scale)
else null;
indicator-x-position =
if cfg != null
then 100
else null;
image = toString ../../assets/BinaryCloud.png;
}
// optionalAttrs (cfg != null) {
indicator-y-position = ((cfg.height * 0.9) / cfg.scale);
indicator-x-position = 100;
};
};

Expand Down
6 changes: 5 additions & 1 deletion home-manager/profiles/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ in
HISTFILE = "${config.xdg.dataHome}/bash_history";
RUSTUP_HOME = "${config.xdg.dataHome}/rustup";
WAKATIME_HOME = "${config.xdg.configHome}/wakatime";
W3M_DIR = "${config.xdg.configHome}/w3m";

};

# Respect XDG spec
Expand Down Expand Up @@ -90,7 +92,6 @@ in
element-desktop

xdg-utils
rustup # TODO: not sure to keep rustup in path
spotify-tui

# CLI tools
Expand Down Expand Up @@ -127,6 +128,9 @@ in
enableZshIntegration = true;
};

# Force override file which is not symlinked for whatever reason and causes errors on rebuilds
xdg.configFile."mimeapps.list".force = true;

programs.go = {
enable = true;
goPath = ".local/share/go";
Expand Down
Loading

0 comments on commit c1a05b7

Please sign in to comment.