1
0
Fork 0

Change to new home-manager installation scheme

This commit is contained in:
Malte Brandy 2020-05-07 15:30:49 +02:00
parent f4f1f8d72d
commit e376f462d0
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
6 changed files with 52 additions and 50 deletions

View file

@ -93,5 +93,13 @@ in {
(setStartpage "https://stats.maralorn.de/d/health-status")
];
hera = { };
hera = makeConfig "hera" [
./home
home/on-my-machine.nix
hosts/hera/weechat
hosts/hera/secret
home/kassandra.nix
home/headless-mpd.nix
home/mail.nix
];
}

21
home/headless-mpd.nix Normal file
View file

@ -0,0 +1,21 @@
{ ... }: {
services = {
mpd = {
enable = true;
network.listenAddress = "::1";
musicDirectory = "/media/audio";
extraConfig = ''
audio_output {
type "httpd"
name "HTTP Stream"
encoder "vorbis"
port "8666"
bitrate "192"
format "44100:16:1"
always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped.
tags "yes" # httpd supports sending tags to listening streams.
}
'';
};
};
}

12
home/kassandra.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
systemd.user.services.kassandra = {
Unit = { Description = "Kassandra Server"; };
Service = {
WorkingDirectory = "/var/www/kassandra";
ExecStart = "/var/www/kassandra/backend -b '::1' ";
Restart = "always";
Environment = "PATH=${pkgs.coreutils}/bin/:${pkgs.taskwarrior}/bin";
};
Install = { WantedBy = [ "default.target" ]; };
};
}

View file

@ -1,46 +0,0 @@
{ pkgs, config, ... }: {
imports = [ ../../home ../../home/on-my-machine.nix ./weechat ./secret ];
m-0 = {
hostName = "hera";
mail = {
enable = true;
accounts = config.m-0.private.mail_accounts;
};
};
services = {
mpd = {
enable = true;
network.listenAddress = "::1";
musicDirectory = "/media/audio";
extraConfig = ''
audio_output {
type "httpd"
name "HTTP Stream"
encoder "vorbis"
port "8666"
bitrate "192"
format "44100:16:1"
always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped.
tags "yes" # httpd supports sending tags to listening streams.
}
'';
};
};
systemd.user = {
services = {
kassandra = {
Unit = { Description = "Kassandra Server"; };
Service = {
WorkingDirectory = "/var/www/kassandra";
ExecStart = "/var/www/kassandra/backend -b '::1' ";
Restart = "always";
Environment = "PATH=${pkgs.coreutils}/bin/:${pkgs.taskwarrior}/bin";
};
Install = { WantedBy = [ "default.target" ]; };
};
};
};
}

View file

@ -27,13 +27,20 @@ in rec {
name = "test-home-config";
inherit bins;
} (haskellBody "home" ''
nix $ ["build", "-f", "<home-manager/home-manager/home-manager.nix>"] ++ paths ++ ["--argstr", "confPath", [i|#{configDir}/hosts/#{hostname}/home.nix|], "--argstr", "confAttr", "", "--out-link", [i|result-home-manager-#{hostname}|], "activationPackage"] ++ fmap toString args
nix $ ["build", "-f", "<home-manager/home-manager/home-manager.nix>"] ++ paths ++ ["--argstr", "confPath", [i|#{configDir}/home.nix|], "--argstr", "confAttr", hostname, "--out-link", [i|result-home-manager-#{hostname}|], "activationPackage"] ++ fmap toString args
'');
repoSrc = "git@hera.m-0.eu:nixos-config";
configPath = "/etc/nixos";
systems = [ "apollo" "hera" ];
homes = [ "apollo" "hera" "hephaistos" ];
homes = [
"apollo-tinkering"
"apollo-leisure"
"apollo-orga"
"apollo-research"
"hera"
"hephaistos"
];
keys = [ "default" "apollo" "hera" ];
test-config = writeHaskellScript {
name = "test-config";

View file

@ -22,7 +22,7 @@ in {
${test-config}/bin/test-config
/run/wrappers/bin/sudo -u ${user} git -C /etc/nixos pull
${update-system}/bin/update-system
/run/wrappers/bin/sudo -u ${user} ${update-home}/bin/update-home
/run/wrappers/bin/sudo -u ${user} ${update-home}/bin/update-home -A hera
'';
};