Skip to content

Commit

Permalink
format nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
izumin5210 committed Apr 7, 2024
1 parent caff294 commit e25f4e1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
53 changes: 32 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,41 @@
pkgs = nixpkgs.legacyPackages.${system};

users = [
{ username = "izumin"; homeDir = "/Users/izumin"; hostname = "fleur.local"; }
{ username = "masayuki.izumi"; homeDir = "/Users/masayuki.izumi"; hostname = "CM2NX3M6CH"; }
{
username = "izumin";
homeDir = "/Users/izumin";
hostname = "fleur.local";
}
{
username = "masayuki.izumi";
homeDir = "/Users/masayuki.izumi";
hostname = "CM2NX3M6CH";
}
];

genHomeConfigurations = usersList: builtins.foldl' (acc: user:
acc // {
"${user.username}" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{ home.username = user.username; home.homeDirectory = user.homeDir; }
./home.nix
];
};
}
) { } usersList;
genHomeConfigurations = usersList:
builtins.foldl' (acc: user:
acc // {
"${user.username}" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
home.username = user.username;
home.homeDirectory = user.homeDir;
}
./home.nix
];
};
}) { } usersList;

genDarwinConfigurations = usersList: builtins.foldl' (acc: user:
acc // {
"${user.hostname}" = nix-darwin.lib.darwinSystem {
inherit pkgs;
modules = [ ./darwin-configuration.nix ];
};
}
) { } usersList;
genDarwinConfigurations = usersList:
builtins.foldl' (acc: user:
acc // {
"${user.hostname}" = nix-darwin.lib.darwinSystem {
inherit pkgs;
modules = [ ./darwin-configuration.nix ];
};
}) { } usersList;
in {
homeConfigurations = genHomeConfigurations users;
darwinConfigurations = genDarwinConfigurations users;
Expand Down
9 changes: 3 additions & 6 deletions home.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{ config, lib, pkgs, ... }:

{
nixpkgs.overlays = [
(import ./overlays/sheldon.nix)
];
nixpkgs.overlays = [ (import ./overlays/sheldon.nix) ];

nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"ngrok"
];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [ "ngrok" ];
# Home Manager needs a bit of information about you and the paths it should
# manage.
# home.username = user.name;
Expand Down

0 comments on commit e25f4e1

Please sign in to comment.