Add Astral host
This commit is contained in:
parent
c2399507d3
commit
b3be9bbad9
9 changed files with 198 additions and 138 deletions
|
|
@ -1,82 +0,0 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
promptSymbol = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Prompt prefix symbol.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
|
||||
users.users.nettika = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid nettika@marauder"
|
||||
];
|
||||
};
|
||||
|
||||
nix.settings.trusted-users = [ "@wheel" ];
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
environment.variables.EDITOR = "nano";
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
config = {
|
||||
init.defaultBranch = "master";
|
||||
user = {
|
||||
email = "git@nettika.cat";
|
||||
name = "Nettika";
|
||||
};
|
||||
credential.helper = "store";
|
||||
};
|
||||
};
|
||||
|
||||
programs.nano = {
|
||||
enable = true;
|
||||
nanorc = ''
|
||||
set autoindent
|
||||
set linenumbers
|
||||
'';
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
promptInit = ''
|
||||
function fish_prompt
|
||||
echo -n '${config.promptSymbol} '
|
||||
if fish_is_root_user
|
||||
set_color red
|
||||
else
|
||||
set_color brgreen
|
||||
end
|
||||
echo -n (prompt_pwd)
|
||||
set_color normal
|
||||
echo -n ' > '
|
||||
end
|
||||
function fish_right_prompt
|
||||
set_color bryellow
|
||||
echo -n (${pkgs.git}/bin/git branch --show-current 2>/dev/null)
|
||||
end
|
||||
'';
|
||||
shellInit = ''
|
||||
set -g fish_greeting
|
||||
set -g fish_prompt_pwd_full_dirs 999
|
||||
'';
|
||||
};
|
||||
|
||||
documentation.man.generateCaches = false;
|
||||
};
|
||||
}
|
||||
4
modules/default.nix
Normal file
4
modules/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
nettika = ./nettika.nix;
|
||||
promptmoji = ./promptmoji.nix;
|
||||
}
|
||||
9
modules/nettika.nix
Normal file
9
modules/nettika.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
users.users.nettika = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHopty1QG8P+OfGxQ9CV0BI1IRB/q6yITzMZaZ6Zspid nettika@marauder"
|
||||
];
|
||||
};
|
||||
}
|
||||
34
modules/promptmoji.nix
Normal file
34
modules/promptmoji.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, config, pkgs, ... }: {
|
||||
options = {
|
||||
promptSymbol = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Prompt prefix symbol.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.fish = lib.mkIf config.programs.fish.enable {
|
||||
promptInit = ''
|
||||
function fish_prompt
|
||||
echo -n '${config.promptSymbol} '
|
||||
if fish_is_root_user
|
||||
set_color red
|
||||
else
|
||||
set_color brgreen
|
||||
end
|
||||
echo -n (prompt_pwd)
|
||||
set_color normal
|
||||
echo -n ' > '
|
||||
end
|
||||
function fish_right_prompt
|
||||
set_color bryellow
|
||||
echo -n (${pkgs.git}/bin/git branch --show-current 2>/dev/null)
|
||||
end
|
||||
'';
|
||||
shellInit = ''
|
||||
set -g fish_greeting
|
||||
set -g fish_prompt_pwd_full_dirs 999
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue