Merge branch 'main' of github.com:asosnovsky/nixos-setup

This commit is contained in:
ari committed 2024-08-11 20:48:52 -04:00
commit 27ffc79f23
18 files changed
+180 -111

No files matched your search

+6
View File
@@ -132,6 +132,12 @@
(import ./hosts/asosnovsky-mac.nix { user = sumoUser; });
};
# None-NIXOS LINUX Setups
# -------------
homeConfigurations."${user.name}" = lib.makeHomeManagerUsers {
user = user;
homeManagerVersion = homeManagerVersion;
};
nixosConfigurations = {
# NIXOS Framework Setups
+2 -1
View File
@@ -1,11 +1,12 @@
{ user, dataDir ? "/mnt/Data", unstable }:
{ pkgs, lib, config, ... }:
let
zshFWBook = builtins.filterSource (p: t: true) ../configs/fwbook;
zshFWBook = builtins.filterSource (p: t: true) ./scripts/fwbook;
zshFunctions = zshFWBook + "/functions.sh";
in
{
imports = [ ./fwbook.hardware-configuration.nix ];
skyg.user.enabled = true;
services.fwupd.enable = true;
services.fwupd.package = (import
(builtins.fetchTarball {
+3 -2
View File
@@ -1,6 +1,7 @@
{ user }:
{ pkgs, lib, config, ... }: {
imports = [ ./hl-bigbox1.hardware-configuration.nix ];
skyg.user.enabled = true;
# firmware updater
services.fwupd.enable = true;
virtualisation.docker.enableNvidia = true;
@@ -75,6 +76,6 @@
steam-tui
steam-run
steamPackages.steamcmd
ollama
];
ollama
];
}
+1
View File
@@ -1,6 +1,7 @@
{ user }:
{ pkgs, lib, config, ... }: {
imports = [ ./hl-minipc1.hardware-configuration.nix ];
skyg.user.enabled = true;
# firmware updater
services.fwupd.enable = true;
+2
View File
@@ -1,6 +1,8 @@
{ user }:
{ pkgs, lib, config, ... }: {
imports = [ ./hl-minipc1.hardware-configuration.nix ];
skyg.user.enabled = true;
# Nix Stores
services.nix-serve = {
enable = true;
+1
View File
@@ -1,6 +1,7 @@
{ user }:
{ pkgs, lib, config, ... }: {
imports = [ ./hl-minipc2.hardware-configuration.nix ];
skyg.user.enabled = true;
# firmware updater
services.fwupd.enable = true;
# Bootloader.
+1
View File
@@ -2,6 +2,7 @@
{ pkgs, lib, config, ... }:
{
imports = [ ./hl-terra1.hardware-configuration.nix ];
skyg.user.enabled = true;
# firmware updater
services.fwupd.enable = true;
# Bootloader.
File renamed without changes.
+58
View File
@@ -0,0 +1,58 @@
{ stateVersion }:
let
makeCommonGitConfigs = (import ./git.nix).makeCommonGitConfigs;
programsModule = (import ./programs.nix);
servicesModule = (import ./services.nix);
homeModule = {
stateVersion = stateVersion;
shellAliases = {
cat = "bat";
};
};
in
{
makeRootUser = { hostName }: { pkgs, ... }: {
home = homeModule;
programs = (programsModule { pkgs = pkgs; }) // {
git = (makeCommonGitConfigs {
userName = "root";
userEmail = "root@${hostName}";
extraGitConfigs = [ ];
});
};
services = servicesModule { pkgs = pkgs; };
};
makeCommonUser =
{ enableDevelopmentKit ? false
, fullName
, email
, extraGitConfigs ? [ ]
, name
, ...
}: { pkgs, ... }: {
home = homeModule // {
username = name;
homeDirectory = "/home/${name}";
packages = with pkgs;
[ jq nixpkgs-fmt ipfetch nixd ]
++ (if enableDevelopmentKit then [
rye
devenv
uv
devbox
terraform
kubectl
] else
[ ]);
};
programs = (programsModule { pkgs = pkgs; }) // {
git = (makeCommonGitConfigs {
userName = fullName;
userEmail = email;
extraGitConfigs = extraGitConfigs;
});
};
services = servicesModule { pkgs = pkgs; };
};
}
+29
View File
@@ -0,0 +1,29 @@
let
gitconfigs =
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
makeCommonGitConfigs =
{ userName
, userEmail
, extraGitConfigs ? [ ]
}: {
enable = true;
userName = userName;
userEmail = userEmail;
delta = { enable = true; };
extraConfig = {
color = { ui = "auto"; };
push = {
default = "upstream";
autoSetupRemote = true;
};
init = { defaultBranch = "main"; };
};
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
++ extraGitConfigs;
};
in
{
makeCommonGitConfigs = makeCommonGitConfigs;
}
File renamed without changes.
+33
View File
@@ -0,0 +1,33 @@
{ pkgs, ... }:
{
bat.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
direnv.enable = true;
lsd = {
enable = true;
enableAliases = true;
};
zsh = {
enable = true;
autosuggestion.enable = true;
initExtra = ''
export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
'';
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
theme = "robbyrussell";
};
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [ nord cpu battery sidebar ];
};
}
+8
View File
@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}
+21 -2
View File
@@ -14,7 +14,7 @@ let
(import ./main.nix attrs)
] ++ extraConfiguration;
eachSystem = nixpkgs.lib.genAttrs (import systems);
pkgs = eachSystem (system:
allPkgs = eachSystem (system:
import nixpkgs {
system = system;
config = { allowUnfree = true; };
@@ -59,13 +59,32 @@ let
})
];
};
makeHomeManagerUsers =
{ modules ? [ ]
, homeManagerVersion
, user
, system ? "x86_64-linux"
}:
let
hm = (import ./home {
stateVersion = homeManagerVersion;
});
pkgs = allPkgs."${system}";
in
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(hm.makeCommonUser user)
] ++ modules;
};
in
{
eachSystem = eachSystem;
pkgs = pkgs;
pkgs = allPkgs;
makeNixOsModule = makeNixOsModule;
makeHLService = makeHLService;
makeDarwinModule = makeDarwinModule;
makeHomeManagerUsers = makeHomeManagerUsers;
makeHLServices =
{ nodeNames ? [ ]
, systemStateVersion ? "24.05"
-1
View File
@@ -12,7 +12,6 @@
{ pkgs, ... }: {
imports = [
(import ./core.nix { user = user; })
./rootUser.nix
(import ./user.nix { user = user; })
(import ./containers/default.nix ({
user = user;
-4
View File
@@ -1,4 +0,0 @@
{ pkgs, ... }:
{
users.users.root.shell = pkgs.zsh;
}
+2 -2
View File
@@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
with lib;
@@ -16,7 +16,7 @@ in
};
config = {
home-manager.users.root.programs.git.userEmail = "root@${cfg.hostName}";
users.users.root.shell = pkgs.zsh;
networking.hostName = cfg.hostName;
};
}
+13 -99
View File
@@ -4,10 +4,6 @@ with lib;
let
cfg = config.skyg;
gitconfigs =
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
in
{
options = {
@@ -15,6 +11,7 @@ in
type = types.str;
};
skyg.user = {
enabled = mkEnableOption "";
name = mkOption {
type = types.str;
};
@@ -39,101 +36,18 @@ in
};
};
config = {
programs.zsh.enable = true;
home-manager.users.root = {
home.stateVersion = cfg.home-manager.version;
programs.git = {
enable = true;
userName = "root";
};
programs.zsh = {
enable = true;
autosuggestion.enable = true;
};
programs.zsh.oh-my-zsh.enable = true;
};
home-manager.users.${cfg.user.name} = {
home = {
sessionVariables = { };
config =
let
hm = (import ../home {
stateVersion = cfg.home-manager.version;
shellAliases = {
cat = "bat";
};
packages = with pkgs;
[ jq nixfmt-classic devenv ipfetch nixd ]
++ (if cfg.user.enableDevelopmentKit then [
rye
uv
devbox
terraform
kubectl
] else
[ ]);
});
in
mkIf cfg.user.enabled
{
programs.zsh.enable = true;
home-manager.users.root =
(hm.makeRootUser { hostName = config.skyg.core.hostName; }) { pkgs = pkgs; };
home-manager.users.${cfg.user.name} =
(hm.makeCommonUser cfg.user) { pkgs = pkgs; };
};
programs = {
bat.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
direnv.enable = true;
lsd = {
enable = true;
enableAliases = true;
};
git = {
enable = true;
userName = cfg.user.fullName;
userEmail = cfg.user.email;
delta = { enable = true; };
extraConfig = {
color = { ui = "auto"; };
push = {
default = "upstream";
autoSetupRemote = true;
};
init = { defaultBranch = "main"; };
};
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
++ cfg.user.extraGitConfigs;
};
zsh = {
enable = true;
autosuggestion.enable = true;
initExtra = ''
export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
'';
};
zsh.oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
theme = "robbyrussell";
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [ nord cpu battery sidebar ];
};
};
};
};
}
# user = {
# name = "ari";
# fullName = "Ari Sosnovsky";
# email = "ariel@sosnovsky.ca";
# };
# sumoUser = rec {
# name = "asosnovsky";
# fullName = user.fullName;
# email = "${name}@sumologic.com";
# homepath = "/Users/${name}";
# extraGitConfigs = [{ path = "${homepath}/.config/mysumo/gitconfig"; }];
# };