Nix is a Tool for building Linux systems in a declarative idempotent method and is a good fit for the CCE, I think when moving past Fedora Linux.
provide 'cce/nixos)
(use-package nix-mode)
(use-package nixpkgs-fmt)
(use-package nix-buffer)
(use-package nix-update)
(use-package company-nixos-options
(
:hooklambda ()
(nix-mode . ('company-backends)
(make-local-variable 'company-backends 'company-nixos-options))))
(add-to-list use-package nix-sandbox)
(
defun cce-find-nix-output-at-point ()
(
(interactive)
(->>
(nix-store-path-at-point)make-instance 'nix-store-path :path )
(
(nix-store-fill-data )
(nix-store-path-outputs )"Select an output" )
(completing-read (find-file)))
Installing Nix on non-NixOS machines
- name: /nix exists
file:
path: /nix
state: directory
owner: "{{local_account}}"
group: "{{local_account}}"
tags:
- nixos
- name: nix installed
shell:
executable: /bin/bash
cmd: "bash <(curl -L https://nixos.org/nix/install) --no-daemon"
creates: /nix/store/
become: yes
become_user: "{{local_account}}"
tags:
- nixos
The Ansible Manages my Laptop until I deploy NixOS and adapt CCE for it.
if [ -e /home/rrix/.nix-profile/etc/profile.d/nix.sh ]; then . /home/rrix/.nix-profile/etc/profile.d/nix.sh; fi
nix
and nixpkgs
configuration for My NixOS
configuration
{ pkgs, config, ... }:
{
# less nix crap
nix.gc = {
automatic = true;
dates = "03:30";
options = "--delete-older-than 30d";
persistent = true;
};
nix.distributedBuilds = true;
nix.buildMachines = builtins.filter (e: e.hostName != config.networking.hostName) [
# { hostName = "virtuous-cassette";
# maxJobs = 6;
# sshUser = "builder";
# systems = [
# "x86_64-linux"
# "aarch64-linux"
# ];
# }
{ hostName = "window-smoke";
maxJobs = 6;
sshUser = "builder";
systems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
}
{ hostName = "last-bank";
maxJobs = 32;
sshUser = "builder";
systems = [
"x86_64-linux"
"i686-linux"
"aarch64-linux"
];
}
] ;
nix.settings.trusted-users = ["rrix" "root" "@wheel"];
nix.settings.extra-experimental-features = [ "flakes" "nix-command" ];
# hahaha! yes
nixpkgs.config = { allowUnfree = true; };
environment.systemPackages = with pkgs; [
nix-tree
nix-du
nurl];
}