Compare commits
2 Commits
1cd22ca95e
...
408081c786
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
408081c786 | ||
|
|
b8ca6cf5c4 |
@@ -1,6 +1,8 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
profile = import ./profile.nix;
|
profile = import ./profile.nix;
|
||||||
|
home-directory = "/home/${profile.username}";
|
||||||
|
ssh-filename = "${home-directory}/.ssh/id_ed25519";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -37,4 +39,22 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.generate-ssh-key = {
|
||||||
|
description = "Generate SSH key if missing";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = user;
|
||||||
|
};
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
if [ ! -f ${ssh-filename} ]; then
|
||||||
|
mkdir -p ${home-directory}/.ssh
|
||||||
|
chmod 700 ${home-directory}/.ssh
|
||||||
|
${pkgs.openssh}/bin/ssh-keygen -t ed25519 -N "" -f ${ssh-filename}
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,23 +4,16 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./editor.nix
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
|
||||||
neovim
|
|
||||||
astyle
|
astyle
|
||||||
python313Packages.pynvim
|
|
||||||
hyfetch
|
hyfetch
|
||||||
fzf
|
|
||||||
fzf-zsh
|
fzf-zsh
|
||||||
ripgrep
|
|
||||||
ripgrep-all
|
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.variables = {
|
|
||||||
EDITOR = "nvim";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clock24 = true;
|
clock24 = true;
|
||||||
|
|||||||
35
terminal-environment/editor.nix
Normal file
35
terminal-environment/editor.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
dotfiles_nvim = pkgs.fetchgit {
|
||||||
|
url = "https://git.nichkara.eu/nichkara/nvim";
|
||||||
|
rev = "4b1aa4c6342a5c1df864247aca3e553d81cc82a9";
|
||||||
|
sha256 = "sha256-0ODOTolosRHVm0Uc2NRGBpUFM5W3C53ScaL9OQQviW0=";
|
||||||
|
};
|
||||||
|
|
||||||
|
profile = import ../profile.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
fzf
|
||||||
|
ripgrep
|
||||||
|
ripgrep-all
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
withPython3 = true;
|
||||||
|
withRuby = true;
|
||||||
|
withNodeJs = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.${profile.username} = { ... }: {
|
||||||
|
home.file.".config/nvim" = {
|
||||||
|
source = dotfiles_nvim;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user