!AinLFXQRxTuqNpXyXk:matrix.org

#nixos

1219 Members
NixCon 2018 CfP is now open! https://nixcon2018.org/ || Share the output of nix-shell -p nix-info --run nix-info to help us help you. || https://nixos.org || Latest NixOS: https://nixos.org/nixos/download.html || Latest Nix: https://nixos.org/nix/download.html || Logs: https://logs.nix.samueldr.com/nixos/ || #nixos-dev, #nix-darwin, #nixos-aarch64, #nixos-chat, #nixcon39 Servers

Load older messages


Timestamp Message
16 Aug 2018
02:10:13@freenode_clever:matrix.orgclever (IRC)you can just do { config, pkgs, resources, ... }: and put all of that into one file if you choose to
02:10:24@freenode_ldlework:matrix.orgldlework (IRC) it isn't like modules can be merged like lists or whatever
02:10:26@freenode_clever:matrix.orgclever (IRC) the nixos module framework takes 100's of modules like this
02:10:33@freenode_clever:matrix.orgclever (IRC)and will then merge them all, based on the option types
02:10:48@freenode_ldlework:matrix.orgldlework (IRC)ok so are the attribute names here basically meaningless?
02:10:56@freenode_ldlework:matrix.orgldlework (IRC)or do they relate to the nixos deployment name
02:11:11@freenode_clever:matrix.orgclever (IRC)the attribute names have to match for it to merge them
02:11:18@freenode_clever:matrix.orgclever (IRC)if they dont match, then nixops will create 2 seperate machines
02:11:31@freenode_ldlework:matrix.orgldlework (IRC)clever: does it like, not merge the modules, per se, but merges their result?
02:11:56@freenode_clever:matrix.orgclever (IRC)i believe it creates a list of modules, grouped by the hostname (the key in the nixops file)
02:12:01@freenode_NinjaTrappeur:matrix.org@freenode_NinjaTrappeur:matrix.org left the room.
02:12:06@freenode_clever:matrix.orgclever (IRC)and then it does a nixos build over each list
02:12:28@freenode_clever:matrix.orgclever (IRC)so its basicaly as-if you had the following in configuration.nix
02:12:29@freenode_ldlework:matrix.orgldlework (IRC)ok at least i understand a bit better and I can break up my file a bit this way
02:12:52@freenode_clever:matrix.orgclever (IRC){ imports = [ (import ./sophos-aws.nix).sophos (import ./sophos.nix).sophos ]; }
02:13:08@freenode_ldlework:matrix.orgldlework (IRC)oh okay so the attributes are just used for grouping
02:13:12@freenode_ldlework:matrix.orgldlework (IRC)that makes more sense to me
02:13:49@freenode_clever:matrix.orgclever (IRC)nixops adds 2 extra arguments that nixos modules can accept, nodes, and resources
02:14:15@freenode_clever:matrix.orgclever (IRC)nodes is a set of every other machine in the cluster, so you can do nodes.sophos.config,services.whatever to read the config of another machine
02:14:41@freenode_clever:matrix.orgclever (IRC)and resources is the non-machine stuff defined in the nixops files
02:14:58@freenode_clever:matrix.orgclever (IRC)in your gist, the only resource is an ec2 keypair
02:16:22@freenode_ldlework:matrix.orgldlework (IRC)thanks for the explication
02:17:07@freenode_clever:matrix.orgclever (IRC) a common reason to split them up like in your gist, is that you can create a sophos-vbox.nix, that sets deployment.targetEnv = "virtualbox"; instead
02:17:10@freenode_clever:matrix.orgclever (IRC)and then if you just swap that file out, you can test the same setup there
02:17:29@freenode_ldlework:matrix.orgldlework (IRC) that's cool
02:18:07@freenode_clever:matrix.orgclever (IRC)ldlework: here is how i manage my house: https://github.com/cleverca22/nixos-configs/blob/mast
02:18:16@freenode_clever:matrix.orgclever (IRC)by just setting targetHost on each machine, nixops will ssh into it and take over
02:18:23@freenode_clever:matrix.orgclever (IRC)and then imports grabs a normal nixos module
02:18:29@freenode_ldlework:matrix.orgldlework (IRC)404
02:18:38@freenode_clever:matrix.orgclever (IRC)https://github.com/cleverca22/nixos-configs/blob/master/deployments/house.nix

There are no newer messages yet.


Back to Room List