forked from c3d2/nix-config
parent
5f8bdae3a8
commit
73b7aa33e6
|
@ -0,0 +1,122 @@
|
||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, pkgs, lib, strings, ... }:
|
||||||
|
|
||||||
|
let eth0 = "ens18";
|
||||||
|
in {
|
||||||
|
imports = [ # Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../lib
|
||||||
|
../../lib/hq.nix
|
||||||
|
../../lib/shared.nix
|
||||||
|
../../lib/default-gateway.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
c3d2 = {
|
||||||
|
users.k-ot = true;
|
||||||
|
isInHq = true;
|
||||||
|
mapHqHosts = true;
|
||||||
|
hq.interface = eth0;
|
||||||
|
};
|
||||||
|
|
||||||
|
hq.yggdrasil = {
|
||||||
|
enable = true;
|
||||||
|
interface = eth0;
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
systemd.enableEmergencyMode = false;
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "storage-ng";
|
||||||
|
# usePredictableInterfacenames = false;
|
||||||
|
interfaces.${eth0} = {
|
||||||
|
ipv4.addresses = [{
|
||||||
|
address = "172.22.99.20";
|
||||||
|
prefixLength = 24;
|
||||||
|
}];
|
||||||
|
ipv6.addresses = [{
|
||||||
|
address = "2a02:8106:208:5201::20";
|
||||||
|
prefixLength = 64;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultGateway.interface = eth0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile. To search, run:
|
||||||
|
# $ nix search wget
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
wget
|
||||||
|
vim
|
||||||
|
screen
|
||||||
|
zsh
|
||||||
|
lftp
|
||||||
|
lsof
|
||||||
|
psmisc
|
||||||
|
gitAndTools.git-annex
|
||||||
|
gitAndTools.git
|
||||||
|
tmux
|
||||||
|
|
||||||
|
mpv
|
||||||
|
iotop
|
||||||
|
];
|
||||||
|
|
||||||
|
services.ceph = {
|
||||||
|
enable = false;
|
||||||
|
client.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# fixme, we need a floating ip here
|
||||||
|
# correct is floating ip 172.22.99.21
|
||||||
|
# does not exist yet
|
||||||
|
|
||||||
|
# secretfile does not work :(
|
||||||
|
|
||||||
|
fileSystems."/mnt/cephfs" = {
|
||||||
|
device = "172.22.99.13:6789:/";
|
||||||
|
fsType = "ceph";
|
||||||
|
options = [
|
||||||
|
"name=storage2"
|
||||||
|
"secret=AQAvRhxcaCK0IxAAnoe00oiopcpQeKZgL02RWw=="
|
||||||
|
"noatime,_netdev"
|
||||||
|
"noauto"
|
||||||
|
"x-systemd.automount"
|
||||||
|
"x-systemd.device-timeout=175"
|
||||||
|
"users"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
# started in user sessions.
|
||||||
|
programs.bash.enableCompletion = true;
|
||||||
|
programs.mtr.enable = true;
|
||||||
|
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# Enable the OpenSSH daemon.
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
services.atftpd = {
|
||||||
|
enable = true;
|
||||||
|
root = "/mnt/cephfs/c3d2/tftp";
|
||||||
|
};
|
||||||
|
|
||||||
|
/* # Open ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
23
|
||||||
|
];
|
||||||
|
networking.firewall.allowedUDPPorts = [
|
||||||
|
69
|
||||||
|
];
|
||||||
|
*/
|
||||||
|
|
||||||
|
networking.firewall.enable = false;
|
||||||
|
|
||||||
|
system.stateVersion = "19.03"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ <nixpkgs/nixos/modules/profiles/qemu-guest.nix>
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/vda1";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/vda3";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/vda2"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
nix.maxJobs = lib.mkDefault 4;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
<html>
|
||||||
|
<head><title>storage.hq.c3d2.de</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>storage-ng</h1>
|
||||||
|
services available:
|
||||||
|
<ul>
|
||||||
|
<li><a href="/c3d2">c3d2 files http</a></li>
|
||||||
|
<li>SAMBA/Windows Access: storage-ng.hq.c3d2.de</li>
|
||||||
|
<li>tftp</li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue