Compare commits
No commits in common. "4bc41031ef153c83c8d67f4f47446afdfed30aa0" and "73844fcf66e039ff96b31e3e6b177192bc4880f2" have entirely different histories.
4bc41031ef
...
73844fcf66
52
flake.nix
52
flake.nix
@ -12,44 +12,38 @@
|
|||||||
outputs =
|
outputs =
|
||||||
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
inputs@{ self, nixpkgs, nixos-unstable, home-manager, vim-extra-plugins }:
|
||||||
let
|
let
|
||||||
x64System = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
wrapPkgsSystem = { system }:
|
pkgs = import nixpkgs {
|
||||||
import nixpkgs rec {
|
inherit system;
|
||||||
inherit system;
|
config.allowUnfree = true;
|
||||||
unstable = wrapUnstablePkgsSystem { inherit system; };
|
overlays = [
|
||||||
config.allowUnfree = true;
|
(final: prev: { inherit unstable; })
|
||||||
overlays = [
|
vim-extra-plugins.overlays.default
|
||||||
(final: prev: { inherit unstable; })
|
];
|
||||||
vim-extra-plugins.overlays.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
wrapUnstablePkgsSystem = { system }:
|
|
||||||
import nixos-unstable {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pkgsX64 = wrapPkgsSystem { system = x64System; };
|
|
||||||
unstableX64 = wrapPkgsSystem { system = x64System; };
|
|
||||||
|
|
||||||
utilsX64 = import ./lib {
|
|
||||||
inherit nixpkgs nixos-unstable home-manager;
|
|
||||||
pkgs = pkgsX64;
|
|
||||||
unstable = unstableX64;
|
|
||||||
system = x64System;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
unstable = import nixos-unstable {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
utils = import ./lib {
|
||||||
|
inherit pkgs unstable nixpkgs nixos-unstable home-manager;
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit (utils) host;
|
||||||
|
inherit (utils) user;
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
architect = utilsX64.host.mkHost {
|
architect = host.mkHost {
|
||||||
name = "architect";
|
name = "architect";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
roles = [ ];
|
roles = [ ];
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
gAluminum = utilsX64.host.mkHost {
|
gAluminum = host.mkHost {
|
||||||
name = "gAluminum";
|
name = "gAluminum";
|
||||||
users = [{
|
users = [{
|
||||||
user = "giulio";
|
user = "giulio";
|
||||||
@ -57,7 +51,7 @@
|
|||||||
}];
|
}];
|
||||||
roles = [ "gnome" ];
|
roles = [ "gnome" ];
|
||||||
};
|
};
|
||||||
proxy = utilsX64.host.mkHost {
|
proxy = host.mkHost {
|
||||||
name = "proxy";
|
name = "proxy";
|
||||||
users = [ ];
|
users = [ ];
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, system, ... }: rec {
|
{ pkgs, unstable, nixpkgs, nixos-unstable, home-manager, ... }: rec {
|
||||||
user = import ./user.nix { inherit pkgs unstable system home-manager; };
|
user = import ./user.nix { inherit pkgs unstable; };
|
||||||
host = import ./host.nix {
|
host = import ./host.nix {
|
||||||
inherit pkgs nixpkgs unstable nixos-unstable home-manager user system;
|
inherit pkgs nixpkgs unstable nixos-unstable home-manager user;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, system, ... }:
|
{ pkgs, nixpkgs, nixos-unstable, unstable, home-manager, user, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
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, home-manager, ... }:
|
{ pkgs, unstable, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
mkUser = { name, roles ? [ ] }:
|
mkUser = { name, roles ? [ ] }:
|
||||||
@ -20,25 +20,7 @@
|
|||||||
extraGroups = [ "wheel" "plugdev" ];
|
extraGroups = [ "wheel" "plugdev" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${name}.imports = [ (mkRole "common") ] ++ roles_mod;
|
home-manager.users.${name}.imports = [ (mkRole "common") ]
|
||||||
};
|
++ 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,7 +3,9 @@
|
|||||||
{
|
{
|
||||||
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…
x
Reference in New Issue
Block a user