diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6721c84 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Immutable NixOS dotfiles."; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs-unstable.url = "nixpgs/master"; + emacs-overlay.url = "github:nix-comunity/emacs-overlay"; + nixos-hardwre.url = "github:nixos/nixos-hardware"; + }; + + outputs = inputs @ { self, nixpkgs, ... }: { + nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./hosts/nixos/configuration.nix + ./hosts/nixos/hardware.nix + ./config/cachix.nix + ]; + }; + }; +} diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix new file mode 100644 index 0000000..4b9999f --- /dev/null +++ b/hosts/nixos/configuration.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: + +{ + nix = { + package = pkgs.nixUnstable; + extraOptions = '' + experimental-features = nix-command flakes + ''; + }; + + nixpkgs = { + config = { allowUnfree = true; }; + overlays = [ ]; + }; + + # ... + +} diff --git a/modules/nix.org b/modules/nix.org new file mode 100644 index 0000000..1166200 --- /dev/null +++ b/modules/nix.org @@ -0,0 +1,27 @@ +#+TITLE: Nix +#+AUTHOR: Christopher James Hayward +#+EMAIL: chris@chrishayward.xyz + +#+PROPERTY: header-args:emacs-lisp :tangle nix.el :comments org +#+PROPERTY: header-args :results silent :eval no-export :comments org + +#+OPTIONS: num:nil toc:nil todo:nil tasks: nil tags:nil +#+OPTIONS: skip:nil author:nil emacs:nil creator:nil timestamp:nil + +* Setup + +*Nix*[fn:1] is a package manager for Linux that uses functional configuration language to build reproducible package deployments. *NixOS*[fn:2] is an extension of the Nix package manager to the entire operating system. + +* Config + +Download and install ~nix-mode~ for working with *Nix* language buffers. + +#+begin_src emacs-lisp +(use-package nix-mode) +#+end_src + +* Footnotes + +[fn:1] https://nixos.org + +[fn:2] https://nixos.org