Inline common module
This commit is contained in:
parent
606dbee8d7
commit
bb53530665
3 changed files with 81 additions and 20 deletions
16
flake.lock
generated
16
flake.lock
generated
|
|
@ -23,21 +23,6 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"locked": {
|
||||
"lastModified": 1750666369,
|
||||
"narHash": "sha256-9dYxGbteo+8Gan0ESKxqq89RDDJYGBD3/85Ea4yOkT8=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "1aef458842d9ff13ef4fca6b81d9e0cb6c6471de",
|
||||
"revCount": 1,
|
||||
"type": "git",
|
||||
"url": "https://git.uninsane.org/nettika/nettika-common"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.uninsane.org/nettika/nettika-common"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -138,7 +123,6 @@
|
|||
"root": {
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"common": "common",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"phps": "phps"
|
||||
}
|
||||
|
|
|
|||
11
flake.nix
11
flake.nix
|
|
@ -11,17 +11,20 @@
|
|||
url = "github:ryantm/agenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
common.url = "git+https://git.uninsane.org/nettika/nettika-common";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, phps, common, agenix, ... }:
|
||||
outputs = { self, nixpkgs, phps, agenix }:
|
||||
let inherit (nixpkgs.lib) nixosSystem;
|
||||
in {
|
||||
nixosModules.common = ./modules/common.nix;
|
||||
nixosConfigurations = {
|
||||
marauder = nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules =
|
||||
[ ./hosts/marauder common.nixosModule agenix.nixosModules.default ];
|
||||
modules = [
|
||||
./hosts/marauder
|
||||
self.nixosModules.common
|
||||
agenix.nixosModules.default
|
||||
];
|
||||
specialArgs = { inherit phps agenix; };
|
||||
};
|
||||
};
|
||||
|
|
|
|||
74
modules/common.nix
Normal file
74
modules/common.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
promptSymbol = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Prompt prefix symbol.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue