1
0
Fork 0
nixos-config/lib/update-system.nix

15 lines
376 B
Nix
Raw Normal View History

2019-07-26 15:31:26 +00:00
nixos-rebuild:
2020-05-16 13:59:02 +00:00
let inherit (import ../lib) writeHaskellScript;
2019-08-02 03:17:00 +00:00
in rec {
2019-07-25 21:35:59 +00:00
configPath = "/etc/nixos";
update-system = writeHaskellScript {
2019-07-31 21:56:52 +00:00
name = "update-system";
2020-05-16 13:59:02 +00:00
bins = [ nixos-rebuild ];
2019-07-31 21:56:52 +00:00
} ''
2019-07-25 21:35:59 +00:00
main = do
2020-05-16 13:59:02 +00:00
paths <- myNixPath "${configPath}/nix/sources.nix"
2019-07-28 22:51:10 +00:00
args <- getArgs
2020-01-19 16:40:02 +00:00
nixos_rebuild (paths ++ ["switch"] ++ fmap toString args)
2019-07-31 21:56:52 +00:00
'';
2019-08-02 03:17:00 +00:00
}