Update configuration.nix
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ---- Clone the config repo ----
|
||||
cd /root
|
||||
|
||||
git clone 'https://gitea.20111511.xyz/h3lp/autodeploy.git'
|
||||
|
||||
cd autodeploy
|
||||
|
||||
# ---- Initialize nixos config ----
|
||||
mkfs.ext4 -F -L nixos /dev/sda1
|
||||
mount /dev/sda1 /mnt/
|
||||
nixos-generate-config --root /mnt
|
||||
|
||||
# ---- Replace configuration with modified one ----
|
||||
mv /mnt/etc/nixos/configuration.nix /mnt/etc/nixos/configuration.nix.bak
|
||||
cp root/etc/nixos/configuration.nix /mnt/mnt/etc/nixos/configuration.nix
|
||||
|
||||
# ---- User configuration ----
|
||||
mkdir --parents /mnt/home/h3lp
|
||||
cp root/home/h3lp/shell.nix /mnt/home/h3lp/shell.nix
|
||||
@@ -75,10 +75,6 @@
|
||||
|
||||
# List packages installed in system profile.
|
||||
# You can use https://search.nixos.org/ to find more packages (and options).
|
||||
# environment.systemPackages = with pkgs; [
|
||||
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
# wget
|
||||
# ];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
@@ -90,31 +86,12 @@
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
};
|
||||
|
||||
users.users.h3lp = {
|
||||
isNormalUser = true;
|
||||
home = "/home/h3lp";
|
||||
description = "Personal account";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"h3lp"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzvHaN1tZOfEIM/XYJCKMrVjs6AUcB8Lr7P2qWjEdp9Hoy1ELDyhCnjSr6BaMriP0F1puEBG8qqccYDOH3Y6bJbde94H6FSQ6dTjXPDko51E21HiY11xa2Dr7n8cxyc37tpL4WLYNihFHQPSHX4K7u9NCNR8jrLM486kaK5mIjB9VKWvArrJSzgbrogXvCmSMP6f5YTw4/jBlUs2ZLVqzJ7yCMHfpoUAiUhVtumDVZ2BcZa3OuWlI6eUl45lA1YyOLc8YhrqxKzUrucsMgQ6Xyx+8s7LshVpIrL7IJ6pg/z9U6RZf2cAt0o/njJkbEkplHFk7UyY63H1mDLtOe28+kfNlLQyPU8KCeYucI1ZL4LwMe/YbmI05WSieDRXkjQ0EV4wa2AnNcBofJeBnueDu86vnH08+ULi4JmM2F/PgNXyaw76vx/Ulopim4I1MlvTeY9sC44Lph2XWrnmq1hdir7z5RuGUDvB5Sk2w/AvnqSNEiZPTbEVezH1gcv/ai+uk= trilolol@trilolol-LINUX" ];
|
||||
};
|
||||
|
||||
users.groups.h3lp.gid = 1000;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
networking.firewall.enable = false;
|
||||
|
||||
# Copy the NixOS configuration file and link it from the resulting system
|
||||
# (/run/current-system/configuration.nix). This is useful in case you
|
||||
@@ -140,5 +117,47 @@
|
||||
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
||||
system.stateVersion = "25.11"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
||||
# Custom part start
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
wget
|
||||
tmux
|
||||
];
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
};
|
||||
|
||||
users.users.h3lp = {
|
||||
isNormalUser = true;
|
||||
home = "/home/h3lp";
|
||||
description = "Personal account";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
"h3lp"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzvHaN1tZOfEIM/XYJCKMrVjs6AUcB8Lr7P2qWjEdp9Hoy1ELDyhCnjSr6BaMriP0F1puEBG8qqccYDOH3Y6bJbde94H6FSQ6dTjXPDko51E21HiY11xa2Dr7n8cxyc37tpL4WLYNihFHQPSHX4K7u9NCNR8jrLM486kaK5mIjB9VKWvArrJSzgbrogXvCmSMP6f5YTw4/jBlUs2ZLVqzJ7yCMHfpoUAiUhVtumDVZ2BcZa3OuWlI6eUl45lA1YyOLc8YhrqxKzUrucsMgQ6Xyx+8s7LshVpIrL7IJ6pg/z9U6RZf2cAt0o/njJkbEkplHFk7UyY63H1mDLtOe28+kfNlLQyPU8KCeYucI1ZL4LwMe/YbmI05WSieDRXkjQ0EV4wa2AnNcBofJeBnueDu86vnH08+ULi4JmM2F/PgNXyaw76vx/Ulopim4I1MlvTeY9sC44Lph2XWrnmq1hdir7z5RuGUDvB5Sk2w/AvnqSNEiZPTbEVezH1gcv/ai+uk= trilolol@trilolol-LINUX" ];
|
||||
};
|
||||
|
||||
users.groups.h3lp.gid = 1000;
|
||||
|
||||
networking.firewall.enable = false;
|
||||
|
||||
systemd.user.services.tmux = {
|
||||
description = "Tmux session manager";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.tmux}/bin/tmux new -A -s main";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
User = "h3lp";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user