better practice, lib.mkDefault, ssh

This commit is contained in:
2025-02-01 23:55:50 +00:00
parent 74911c6563
commit 93eab92cf1
7 changed files with 40 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
{
"conform.nvim": { "branch": "master", "commit": "363243c03102a531a8203311d4f2ae704c620d9b" },
"fidget.nvim": { "branch": "main", "commit": "a0abbf18084b77d28bc70e24752e4f4fd54aea17" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" },
"lazy.nvim": { "branch": "main", "commit": "7527af40ddd4a93a02911be570b32609b9d4ea53" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "f75e877f5266e87523eb5a18fcde2081820d087b" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.nvim": { "branch": "main", "commit": "12ebac8280869048c286d13bd35cfa6653e07642" },
"nvim-lspconfig": { "branch": "master", "commit": "9962e25a23f0e992116b99a9a6400947d5a7177b" },
"nvim-treesitter": { "branch": "master", "commit": "80c7af6d0408411ff1f502fbac8ca94b738b8762" },
"mini.nvim": { "branch": "main", "commit": "034698a100e91fd5798b27c2927378eb5b06615a" },
"nvim-lspconfig": { "branch": "master", "commit": "f98fa715acc975c2dd5fb5ba7ceddeb1cc725ad2" },
"nvim-treesitter": { "branch": "master", "commit": "4988b7068001b3a772c7cc738708341e612e3c26" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"rose-pine": { "branch": "main", "commit": "42f0724e0bca9f57f0bcfa688787c37b8d4befe8" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }

View File

@@ -89,7 +89,8 @@
isNormalUser = true;
extraGroups = [ "wheel" ];
shell = pkgs.zsh;
hashedPassword = "$y$j9T$wp9I05TfxjrAzCMCcxlei1$Fm7sJJSwFHpSIQT0RESOdJ7vkTYyN0IXs5n/xkg65y3";
hashedPassword = config.hashedPassword;
openssh.authorizedKeys.keys = config.authorized_ssh;
};
environment.systemPackages =
@@ -106,7 +107,5 @@
# enableSSHSupport = true;
# };
services.openssh.enable = true;
system.stateVersion = "24.11";
}

View File

@@ -17,7 +17,10 @@
wsl.defaultUser = "luca";
networking.hostName = meta.hostname;
hm.enable = true;
users.users.luca.shell = pkgs.zsh;
users.users.luca = {
shell = pkgs.zsh;
openssh.authorizedKeys.keys = config.authorized_ssh;
};
environment.systemPackages = with pkgs; config.commonPackages ++ [ ];

View File

@@ -17,7 +17,10 @@
wsl.defaultUser = "luca";
networking.hostName = meta.hostname;
hm.enable = true;
users.users.luca.shell = pkgs.zsh;
users.users.luca = {
shell = pkgs.zsh;
openssh.authorizedKeys.keys = config.authorized_ssh;
};
environment.systemPackages = with pkgs; config.commonPackages ++ [ ];

View File

@@ -25,10 +25,11 @@
wireguard-tools
fzf
];
programs.nix-ld.enable = true;
programs.zsh.enable = true;
programs.nix-ld.enable = lib.mkDefault true;
programs.zsh.enable = lib.mkDefault true;
services.openssh.enable = lib.mkDefault true;
programs.neovim = {
programs.neovim = lib.mkDefault {
enable = true;
defaultEditor = true;
vimAlias = true;

View File

@@ -11,5 +11,6 @@
./i3.nix
./kanata.nix
./pipewire.nix
./keys.nix
];
}

20
nix/modules/keys.nix Normal file
View File

@@ -0,0 +1,20 @@
{
pkgs,
lib,
config,
...
}:
{
options = {
authorized_ssh = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDBIvu/oh6LiuRvrluMV1hStvgdg0x1KNWnNxlR26zer75z2dEQcyou54uTyqJ0hbQXRTaolD5GxAoCc0HdPMkXiZJYPyMl65mVxyFWreXgFNSAAx5z/3D7B23qGNOBcc8mIiDwcNL5gKCzm5kHlRp9XY+VMTc8i89Abj3eo3pubcw2P8u8kmNgkswHrcwTjCDP6MBVkE0LwoamhB/KrpnYJrqsoBcOljhlKh6w9EBGcZPYBA1tg555IywZ89B4Kty5/0ydaO3E/qpr8lXfVRrhA7JRzeuUfnkXJLJetmwLT28O5fn+swzwdMM3TUbtL73ncGaLHR0/cpeTSgVxAV9KLMJIhS9EULlz9Fk79nWZ0w+JHjzVbmwWXA9GABMr1OgfksqNhs/FDQeyMYTf8+o7lGKtl1eHmD3TuuENIAIrq3RvIY5Q8O4xpioWZA9mZ3bLkp1EBowT6z059iDoxTw0fRWmegEXpSvbleXH7So68W72YJo200IXcwfizfwTsPE= luca@DESKTOP-G36D6AR"
];
};
hashedPassword = lib.mkOption {
type = lib.types.str;
default = "$y$j9T$wp9I05TfxjrAzCMCcxlei1$Fm7sJJSwFHpSIQT0RESOdJ7vkTYyN0IXs5n/xkg65y3";
};
};
}