Compare commits
3 commits
b5047046dc
...
fa1d506357
Author | SHA1 | Date | |
---|---|---|---|
fa1d506357 | |||
b111910e64 | |||
cc2bae9274 |
4 changed files with 55 additions and 35 deletions
52
flake.lock
generated
52
flake.lock
generated
|
@ -124,11 +124,11 @@
|
||||||
"pyproject-nix": "pyproject-nix"
|
"pyproject-nix": "pyproject-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720605900,
|
"lastModified": 1720713418,
|
||||||
"narHash": "sha256-/BTAC3gj1Ot7o/PINsHS2EGEtGUadI12WZlhowKn18c=",
|
"narHash": "sha256-6Sdzq2JhHW28GLXcCBConJSxz24bKQXWL7Z3JTOlU0A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "dream2nix",
|
"repo": "dream2nix",
|
||||||
"rev": "0c6b5c8ab796f6dfb2aef1133f5b7bb25ce57cb9",
|
"rev": "0859b0dfdfe39e6e6479c8991f81336c13471255",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -818,11 +818,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720646128,
|
"lastModified": 1720734513,
|
||||||
"narHash": "sha256-BivO5yIQukDlJL+1875Sqf3GuOPxZDdA48dYDi3PkL8=",
|
"narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "c085b984ff2808bf322f375b10fea5a415a9c43d",
|
"rev": "90ae324e2c56af10f20549ab72014804a3064c7f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -872,11 +872,11 @@
|
||||||
"lix": {
|
"lix": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720633647,
|
"lastModified": 1720733512,
|
||||||
"narHash": "sha256-CjWvti4wFhRmIHpLduohKAVmU9+wI/PAOhQppCWziK8=",
|
"narHash": "sha256-vq9CLDvqSSvH4L7YhDa0ihTOrAry4jntKiuoNb5n98M=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "014410cbf0bda9c0fcdaf5f894120883cdc805ce",
|
"rev": "4b109ec1a8fc4550150f56f0f46f2f41d844bda8",
|
||||||
"revCount": 15944,
|
"revCount": 15950,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git@git.lix.systems/lix-project/lix"
|
"url": "https://git@git.lix.systems/lix-project/lix"
|
||||||
},
|
},
|
||||||
|
@ -897,11 +897,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719353937,
|
"lastModified": 1720695775,
|
||||||
"narHash": "sha256-86NBqDxAP20ET/UoKX0WvSItblNQ97czXb2q7lkMrwk=",
|
"narHash": "sha256-8Oqzl9QPjEe/n8y0R2tC6+2v/H6xBgABHXOJwxmnBg0=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "5d9d94089fb1ca96222a34bfe245ef5c5ebefd37",
|
"rev": "d70318fb946a0e720dfdd1fb10b0645c14e2a02a",
|
||||||
"revCount": 92,
|
"revCount": 94,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/nixos-module"
|
"url": "https://git.lix.systems/lix-project/nixos-module"
|
||||||
},
|
},
|
||||||
|
@ -1001,11 +1001,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720599442,
|
"lastModified": 1720845312,
|
||||||
"narHash": "sha256-jdm+sKVbBXoyrxcHbVaV0htlpq2iFR+eJw3Xe/DPcDo=",
|
"narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=",
|
||||||
"owner": "LnL7",
|
"owner": "LnL7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "cf297a8d248db6a455b60133f6c0029c04ebe50e",
|
"rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1060,11 +1060,11 @@
|
||||||
},
|
},
|
||||||
"nixosHardware": {
|
"nixosHardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720515935,
|
"lastModified": 1720737798,
|
||||||
"narHash": "sha256-8b+fzR4W2hI5axwB+4nBwoA15awPKkck4ghhCt8v39M=",
|
"narHash": "sha256-G/OtEAts7ZUvW5lrGMXSb8HqRp2Jr9I7reBuvCOL54w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "a111ce6b537df12a39874aa9672caa87f8677eda",
|
"rev": "c5013aa7ce2c7ec90acee5d965d950c8348db751",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1245,11 +1245,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgsStable": {
|
"nixpkgsStable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719957072,
|
"lastModified": 1720535198,
|
||||||
"narHash": "sha256-gvFhEf5nszouwLAkT9nWsDzocUTqLWHuL++dvNjMp9I=",
|
"narHash": "sha256-zwVvxrdIzralnSbcpghA92tWu2DV2lwv89xZc8MTrbg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7144d6241f02d171d25fba3edeaf15e0f2592105",
|
"rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1820,11 +1820,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1720645794,
|
"lastModified": 1720818892,
|
||||||
"narHash": "sha256-vAeYp+WH7i/DlBM5xNt9QeWiOiqzzf5abO8DYGkbUxg=",
|
"narHash": "sha256-f52x9srIcqQm1Df3T+xYR5P6VfdnDFa2vkkcLhlTp6U=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "750dfb555b5abdab4d3266b3f9a05dec6d205c04",
|
"rev": "5b002f8a53ed04c1a4177e7b00809d57bd2c696f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
fleetFlake,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
sshdTmpDirectory = "${config.user.home}/sshd-tmp";
|
sshdTmpDirectory = "${config.user.home}/sshd-tmp";
|
||||||
sshdDirectory = "${config.user.home}/sshd";
|
sshdDirectory = "${config.user.home}/sshd";
|
||||||
pathToPubKey = "/mnt/sdcard/Download/picard_host_key.pub";
|
|
||||||
port = 8022;
|
port = 8022;
|
||||||
in {
|
in {
|
||||||
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
# Backup etc files instead of failing to activate generation if a file already exists in /etc
|
||||||
environment.etcBackupExtension = ".bak";
|
environment.etcBackupExtension = ".bak";
|
||||||
|
|
||||||
# Read the changelog before changing this value
|
# Read the changelog before changing this value
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "24.05";
|
||||||
|
|
||||||
# Set up nix for flakes
|
# Set up nix for flakes
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
|
@ -23,9 +23,25 @@ in {
|
||||||
# Set your time zone
|
# Set your time zone
|
||||||
time.timeZone = "Europe/Rome";
|
time.timeZone = "Europe/Rome";
|
||||||
|
|
||||||
build.activation.sshd = ''
|
home-manager.config = {pkgs, ...}: {
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
_module.args = {
|
||||||
|
hostname = "janeway";
|
||||||
|
age.secrets = {};
|
||||||
|
};
|
||||||
|
imports = [../../hmModules/shell];
|
||||||
|
};
|
||||||
|
|
||||||
|
build.activation.sshd = let
|
||||||
|
keys = (builtins.import ../../lib).keys;
|
||||||
|
inherit (keys) hosts users;
|
||||||
|
in ''
|
||||||
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh"
|
$DRY_RUN_CMD mkdir $VERBOSE_ARG --parents "${config.user.home}/.ssh"
|
||||||
$DRY_RUN_CMD cat ${pathToPubKey} > "${config.user.home}/.ssh/authorized_keys"
|
$DRY_RUN_CMD echo ${hosts.picard} > "${config.user.home}/.ssh/authorized_keys"
|
||||||
|
$DRY_RUN_CMD echo ${hosts.sisko} >> "${config.user.home}/.ssh/authorized_keys"
|
||||||
|
$DRY_RUN_CMD echo ${hosts.kirk} >> "${config.user.home}/.ssh/authorized_keys"
|
||||||
|
$DRY_RUN_CMD echo ${users.ccr-ssh} >> "${config.user.home}/.ssh/authorized_keys"
|
||||||
|
$DRY_RUN_CMD echo ${users.ccr-gpg} >> "${config.user.home}/.ssh/authorized_keys"
|
||||||
|
|
||||||
if [[ ! -d "${sshdDirectory}" ]]; then
|
if [[ ! -d "${sshdDirectory}" ]]; then
|
||||||
$DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}"
|
$DRY_RUN_CMD rm $VERBOSE_ARG --recursive --force "${sshdTmpDirectory}"
|
||||||
|
@ -41,16 +57,18 @@ in {
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.packages = [
|
environment.packages = let
|
||||||
pkgs.vim
|
inherit (fleetFlake.inputs.ccrEmacs.packages.aarch64-linux) ccrEmacs;
|
||||||
|
in [
|
||||||
pkgs.bottom
|
pkgs.bottom
|
||||||
pkgs.helix
|
pkgs.helix
|
||||||
pkgs.stress
|
pkgs.stress
|
||||||
pkgs.openssh
|
pkgs.openssh
|
||||||
pkgs.git
|
pkgs.git
|
||||||
|
pkgs.btop
|
||||||
|
ccrEmacs
|
||||||
(pkgs.writeScriptBin "sshd-start" ''
|
(pkgs.writeScriptBin "sshd-start" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
|
|
||||||
echo "Starting sshd in non-daemonized way on port ${toString port}"
|
echo "Starting sshd in non-daemonized way on port ${toString port}"
|
||||||
${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D
|
${pkgs.openssh}/bin/sshd -f "${sshdDirectory}/sshd_config" -D
|
||||||
'')
|
'')
|
||||||
|
|
|
@ -291,6 +291,7 @@ in {
|
||||||
internal = true;
|
internal = true;
|
||||||
default = hostname: config:
|
default = hostname: config:
|
||||||
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
inputs.nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
|
pkgs = inputs.nixpkgsUnstable.legacyPackages.aarch64-linux;
|
||||||
modules = [
|
modules = [
|
||||||
({
|
({
|
||||||
lib,
|
lib,
|
||||||
|
@ -298,6 +299,7 @@ in {
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
nixpkgs.overlays = config.overlays;
|
nixpkgs.overlays = config.overlays;
|
||||||
|
_module.args.fleetFlake = self;
|
||||||
})
|
})
|
||||||
"${self.outPath}/hosts/${hostname}"
|
"${self.outPath}/hosts/${hostname}"
|
||||||
];
|
];
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"tcp://kirk.fleet"
|
"tcp://kirk.fleet"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
onplus8t = {
|
oneplus8t = {
|
||||||
id = "76BJ2ZE-FPFDWUZ-3UZIENZ-TS6YBGG-EZSF6UE-GLHRBQ2-KTHTRMI-3JWNRAT";
|
id = "76BJ2ZE-FPFDWUZ-3UZIENZ-TS6YBGG-EZSF6UE-GLHRBQ2-KTHTRMI-3JWNRAT";
|
||||||
addresses = [
|
addresses = [
|
||||||
"tcp://oneplus8t.fleet"
|
"tcp://oneplus8t.fleet"
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
kirk = "/home/${config.ccr.username}/org";
|
kirk = "/home/${config.ccr.username}/org";
|
||||||
}
|
}
|
||||||
.${config.networking.hostName};
|
.${config.networking.hostName};
|
||||||
devices = ["picard" "sisko" "kirk" "onplus6t"];
|
devices = ["picard" "sisko" "kirk" "oneplus8t"];
|
||||||
};
|
};
|
||||||
sync = {
|
sync = {
|
||||||
path =
|
path =
|
||||||
|
|
Loading…
Add table
Reference in a new issue