Coder Social home page Coder Social logo

nixos-config's Introduction

Setup

First, install the starter template in a new directory:

mkdir -p nixos-config && cd nixos-config && nix flake --extra-experimental-features 'nix-command flakes' init -t github:dustinlyons/nixos-config#starter

Apply command will update the template with the inputs, mostly for git config:

nix run .#apply

Build will install and compile the various packages specified:

nix run .#build

Finally, when ready to update your computer with config you just built, run the build-switch command. You will need to enable both flakes and nix-command. As I understand, they are experimental features that the nix community is converging on, but are not standardized yet.

nix run --extra-experimental-features 'nix-command flakes' .#build-switch

Manual installation

Currently, I have installed the following packages manually. Eventually, I will tweak the starter config to include them automatically.

  nix profile install nixpkgs#elixir_1_17
  nix proflie install nixpkgs#erlang_25
  nix profile install nixpkgs#chromedriver
  nix profile install nixpkgs#rustup
  nix profile install nixpkgs#rustc
  nix profile install nixpkgs#postgresql_16
  nix profile install nixpkgs#rectangle
  nix profile install nixpkgs#maccy

Postgres Installation

After installing the postgres package, we'll want to make sure it runs each time the computer starts. First, we'll need to initialize the database:

export DB_DATA='/Users/ryancurtin/src/postgres/data'
initdb -D $DB_DATA

Now that postgres has been initialized in the directory of your choosing, we'll need to create a Launch Config to run via launchctl. Copy the provided wrapper script in scripts/postgres-wrapper.sh to your $DB_DATA directory, and then copy the launchctl/org.postgresql.plist launch config to the appropriate directory:

cp scripts/postgres-wrapper.sh $DB_DATA/postgres-wrapper.sh
cp launchctl/org.postgresql.plist ~/Library/LaunchAgents/org.postgresql.plist

Once all of your files are in place, we'll need to load the config and attempt to start the service:

launchctl load ~/Library/LaunchAgents/org.postgresql.plist
launchctl start org.postgresql

If that was successful, you'll see postgres running, and you should be able to connect once the proper role is created:

createuser -s postgres
psql

Once in the console, you should be able to run postgres commands! If you want to run postgres each time the computer starts, open System Settings > General > Login Items and add your org.postgresql.plist file to the list. You may need to add that directory to the left-hand bar if you are performing this change in Finder.

nixos-config's People

Contributors

ryancurtin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.