Compare commits
3 Commits
73844fcf66
...
4bc41031ef
Author | SHA1 | Date | |
---|---|---|---|
|
4bc41031ef | ||
|
334a606f11 | ||
|
45935b999e |
28
flake.nix
28
flake.nix
@ -12,10 +12,12 @@
|
|||||||
outputs =
|
outputs =
|
||||||
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
x64System = "x86_64-linux";
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
wrapPkgsSystem = { system }:
|
||||||
|
import nixpkgs rec {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
unstable = wrapUnstablePkgsSystem { inherit system; };
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
overlays = [
|
overlays = [
|
||||||
(final: prev: { inherit unstable; })
|
(final: prev: { inherit unstable; })
|
||||||
@ -23,27 +25,31 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
unstable = import nixos-unstable {
|
wrapUnstablePkgsSystem = { system }:
|
||||||
|
import nixos-unstable {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
utils = import ./lib {
|
pkgsX64 = wrapPkgsSystem { system = x64System; };
|
||||||
inherit pkgs unstable nixpkgs nixos-unstable home-manager;
|
unstableX64 = wrapPkgsSystem { system = x64System; };
|
||||||
};
|
|
||||||
|
|
||||||
inherit (utils) host;
|
utilsX64 = import ./lib {
|
||||||
inherit (utils) user;
|
inherit nixpkgs nixos-unstable home-manager;
|
||||||
|
pkgs = pkgsX64;
|
||||||
|
unstable = unstableX64;
|
||||||
|
system = x64System;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
architect = host.mkHost {
|
architect = utilsX64.host.mkHost {
|
||||||
name = "architect";
|
name = "architect";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
roles = [ ];
|
roles = [ ];
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
gAluminum = host.mkHost {
|
gAluminum = utilsX64.host.mkHost {
|
||||||
name = "gAluminum";
|
name = "gAluminum";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
@ -51,7 +57,7 @@
|
|||||||
}];
|
}];
|
||||||
roles = [ "gnome" ];
|
roles = [ "gnome" ];
|
||||||
};
|
};
|
||||||
proxy = host.mkHost {
|
proxy = utilsX64.host.mkHost {
|
||||||
name = "proxy";
|
name = "proxy";
|
||||||
users = [ ];
|
users = [ ];
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, ... }: rec {
|
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, system, ... }: rec {
|
||||||
user = import ./user.nix { inherit pkgs unstable; };
|
user = import ./user.nix { inherit pkgs unstable system home-manager; };
|
||||||
host = import ./host.nix {
|
host = import ./host.nix {
|
||||||
inherit pkgs nixpkgs unstable nixos-unstable home-manager user;
|
inherit pkgs nixpkgs unstable nixos-unstable home-manager user system;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, ... }:
|
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, system, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
mkHost = { name, users, roles ? [ ], imports ? [ ] }:
|
mkHost = { name, users, roles ? [ ], imports ? [ ] }:
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
|
||||||
|
|
||||||
mkRole = role: import (../roles + "/${role}.nix");
|
mkRole = role: import (../roles + "/${role}.nix");
|
||||||
|
|
||||||
users_mod = (map (u:
|
users_mod = (map (u:
|
||||||
|
24
lib/user.nix
24
lib/user.nix
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, unstable, ... }:
|
{ pkgs, unstable, home-manager, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
mkUser = { name, roles ? [ ] }:
|
mkUser = { name, roles ? [ ] }:
|
||||||
@ -20,7 +20,25 @@
|
|||||||
extraGroups = [ "wheel" "plugdev" ];
|
extraGroups = [ "wheel" "plugdev" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${name}.imports = [ (mkRole "common") ]
|
home-manager.users.${name}.imports = [ (mkRole "common") ] ++ roles_mod;
|
||||||
++ roles_mod;
|
};
|
||||||
|
|
||||||
|
mkHMUser = { name, roles }:
|
||||||
|
let
|
||||||
|
mkRole = role: import (../roles/home + "/${role}.nix");
|
||||||
|
roles_mod = (map (r: mkRole r) roles);
|
||||||
|
in home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
username = name;
|
||||||
|
homeDirectory =
|
||||||
|
if pkgs.stdenv.isLinux then "/home/${name}" else "/Users/${name}";
|
||||||
|
stateVersion = "22.05";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
(mkRole "common")
|
||||||
|
] ++ roles_mod;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [ ./zsh.nix ./git.nix ];
|
imports = [ ./zsh.nix ./git.nix ];
|
||||||
|
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "21.05";
|
|
||||||
sessionVariables = {
|
sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
VISUAL = "nvim";
|
VISUAL = "nvim";
|
||||||
|
Loading…
Reference in New Issue
Block a user